You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
983 B
44 lines
983 B
2 years ago
|
"use strict";
|
||
|
Component({
|
||
|
properties: {
|
||
|
list: {
|
||
|
type: Array,
|
||
|
value: [
|
||
|
{
|
||
|
name: "",
|
||
|
value: "",
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
selected: {
|
||
|
type: String,
|
||
|
value: "",
|
||
|
},
|
||
|
fm: {
|
||
|
type: String,
|
||
|
value: "fmData",
|
||
|
},
|
||
|
name: {
|
||
|
type: String,
|
||
|
value: "",
|
||
|
},
|
||
|
},
|
||
|
data: {},
|
||
|
lifetimes: {
|
||
|
ready: function () {
|
||
|
this.init();
|
||
|
},
|
||
|
},
|
||
|
methods: {
|
||
|
init: function () {
|
||
|
console.log("单选框组件初始化完成");
|
||
|
},
|
||
|
select: function (e) {
|
||
|
var value = e.currentTarget.dataset.value;
|
||
|
var _a = this.data, fm = _a.fm, name = _a.name;
|
||
|
this.setData({ selected: value });
|
||
|
this.triggerEvent("select", { fm: fm, name: name, value: value });
|
||
|
},
|
||
|
},
|
||
|
});
|