New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-font-resize

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-font-resize

The Font Size Adapts To The Container Width

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

vue-font-resize

Note: vue-font-resize@0.x only works with vue@2.x

Overview

This allows the text to automatically fit into the size of the containe, when the text content changes the size of the text automatically changes, so that the text always appears in the container.

The max(32px by default) and min(10px by default) can also be passed by setting to display the maximum and minimum font sizes.

When the text size is the smallest content length still exceeds the container width an ellipsis is used instead。

Requirements

  • vue: ^2.0.0

Usage

// Import In main.js
import { fontResize } from "vue-font-resize";
Vue.use(fontResize);

export default {
  data() {return {text: "vue-font-resize"}},
  template: "<div style='width: 100px;' v-font-resize="{max: 32, min: 10}"> {{ text }} </div>"
};

// Import As mixins
import { mixin as fontResize } from "vue-font-resize";
export default {
  data() {return {text: "vue-font-resize"}},
  template: "<div style='width: 100px;' v-font-resize> {{ text }} </div>",
  mixins: [fontResize]
};

// Import As directives
import { directive as fontResize } from "vue-font-resize";
export default {
  data() {return {text: "vue-font-resize"}},
  template: "<div style='width: 100px;' v-font-resize> {{ text }} </div>",
  directives: {fontResize: fontResize }
};

License

MIT

Keywords

FAQs

Package last updated on 25 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc