123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- // components/modal/modal.js
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- title: {
- type: String,
- value: '标题'
- },
- ModalType: {
- type: String,
- value: 'text'
- },
- content: {
- type: String,
- value: ''
- },
- btnText: {
- type: String,
- value: '确定'
- },
- ShowModal: {
- type: Boolean,
- value: false
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- Phone: ''
- },
- /**
- * 组件的方法列表
- */
- methods: {
- saveFun: function (e) {
- if (this.properties.ModalType === 'input') {
- this.triggerEvent('click', this.data.Phone)
- } else {
- this.triggerEvent('click')
- }
- this.setData({Phone: ''})
- },
- inputPhone: function (e) {
- this.setData({
- Phone: e.detail.value
- })
- }
- }
- })
|