diff --git a/src/coupon-list/README.md b/src/coupon-list/README.md index c2e4c0b03..b73ecad38 100644 --- a/src/coupon-list/README.md +++ b/src/coupon-list/README.md @@ -18,20 +18,20 @@ app.use(CouponList); ```html { + state.showList = false; + state.chosenCoupon = index; + }; + const onExchange = (code) => { + state.coupons.push(coupon); + }; + + return { + state, + onChange, + onExchange, disabledCoupons: [coupon], }; }, - methods: { - onChange(index) { - this.showList = false; - this.chosenCoupon = index; - }, - onExchange(code) { - this.coupons.push(coupon); - }, - }, }; ``` diff --git a/src/coupon-list/README.zh-CN.md b/src/coupon-list/README.zh-CN.md index ae27d25dc..57728dc55 100644 --- a/src/coupon-list/README.zh-CN.md +++ b/src/coupon-list/README.zh-CN.md @@ -18,20 +18,20 @@ app.use(CouponList); ```html { + state.showList = false; + state.chosenCoupon = index; + }; + const onExchange = (code) => { + state.coupons.push(coupon); + }; + + return { + state, + onChange, + onExchange, disabledCoupons: [coupon], }; }, - methods: { - onChange(index) { - this.showList = false; - this.chosenCoupon = index; - }, - onExchange(code) { - this.coupons.push(coupon); - }, - }, }; ``` diff --git a/src/coupon-list/demo/index.vue b/src/coupon-list/demo/index.vue index b5dd09da0..b5b3f7c3d 100644 --- a/src/coupon-list/demo/index.vue +++ b/src/coupon-list/demo/index.vue @@ -9,7 +9,7 @@ v-model:show="showList" round position="bottom" - style="height: 90%; padding-top: 4px;" + style="height: 90%; padding-top: 4px" > -