vue 动态设置组件高度
虚拟动态星级 (vue-dynamic-star-rating)
A Highly Customizable, easy-to-use elegant stars rating component (similar to Google Play)
高度可定制,易于使用的优雅星级评定组件(类似于Google Play)
View Demo 查看演示 Download Source 下载源
用法 (Usage)
Install via NPMnpm i vue-dynamic-star-rating
通过NPMnpm i vue-dynamic-star-rating
Then require in your project:
然后在您的项目中要求:
var StarRating = require('vue-dynamic-star-rating');
or ES6 syntax:
或ES6语法:
import StarRating from 'vue-dynamic-star-rating'
Then you can register the component globally:
然后,您可以全局注册该组件:
ponent('star-rating', StarRating);
Or in your Vue component:
或在您的Vue组件中:
components: {StarRating}
You can then use the following selector anywhere in your project:
然后,您可以在项目中的任何地方使用以下选择器:
To get up and running quick the package now supports rendering just the selector with default values
为了快速启动和运行,该软件包现在支持仅渲染具有默认值的选择器
<star-rating></star-rating>
文件 (Docs)
config: {...}
is a configuration object that is to be binded to vue-star-rating, api properties are:
config: {...}
是要绑定到vue-star-rating的配置对象,api属性为:
基本 (Basics)
定制样式 (Customized Styling)
实施实例 (Implementation Example)
Define yourconfigoptions object in the component importing StarRating e.g
在导入StarRating的组件中定义您的配置选项对象,例如
data: function() {return {config: {rating: 4.7,style: {fullStarColor: '#ed8a19',emptyStarColor: '#737373',starWidth: 30,starHeight: 30}}}}
And bind it to the selector like so
然后像这样将其绑定到选择器
<star-rating :config="config"></star-rating>
翻译自: /a-highly-dynamic-vue-stars-rating-component/
vue 动态设置组件高度
如果觉得《vue 动态设置组件高度_高度动态的Vue明星评分组件》对你有帮助,请点赞、收藏,并留下你的观点哦!