| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- Component({
- externalClasses: ['custom-class'],
- properties: {
- // 评分值
- value: {
- type: Number,
- value: 5
- },
- // 评分数量
- count: {
- type: Number,
- value: 5
- },
- // 评分标签
- label: {
- type: Array,
- value: ['非常差', '较差', '一般', '满意', '非常满意']
- },
- // 是否禁用
- disabled: {
- type: Boolean,
- value: false
- }
- },
- data: {
- },
- methods: {
- //选择评分等级
- onChange(e:any) {
- if (!this.data.disabled) {
- this.setData({
- value: e.currentTarget.dataset.index + 1
- }, () => {
- this.triggerEvent('change', {
- value: this.data.value
- })
- })
- }
- }
- }
- })
|