Skip to content

Instantly share code, notes, and snippets.

@ygmpkk
Created October 30, 2018 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ygmpkk/9ab5adc57a76cb71eb78b895f9aee8d8 to your computer and use it in GitHub Desktop.
Save ygmpkk/9ab5adc57a76cb71eb78b895f9aee8d8 to your computer and use it in GitHub Desktop.
淘宝小程序 switch
<template>
<view class="container">
<view>
DEBUG MODE: {{ debug }}
</view>
<view>
<switch :checked='debug' @change='handleChanged' />
</view>
</view>
</template>
<style></style>
<script>
export default {
data() {
return {
debug: false,
};
},
methods: {
handleChanged(e) {
const { checked } = e.detail
this.debug = checked
},
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment