随笔分类 - vue
vue
摘要:v-if 指令用于条件性地渲染一块内容。这块内容只会在指令的表达式返回 truthy 值的时候被渲染。 <div id="app"> <p v-if="seen">www.gzsmbj.com</p></div> var app3 = new Vue({ el: '#app', data: { se
阅读全文
摘要:$emit绑定一个自定义事件, 当这个语句被执行时, 就会将参数arg传递给父组件,父组件通过v-on监听并接收参数。 我们在Children.vue中绑定了click事件,通过单击来触发方法函数:doSomething() methods: { doSomething() { // todo co
阅读全文
摘要:<img :src="imgSrc" :width="imgWidth" :height="imgHeight" :alt="title" @click="doSomething"> 子组件写 props:{ imgWidth: { type: Number, default: 300 }, img
阅读全文
摘要:vue中常见的指令 v-html v-bind v-on v-mode v-if v-for 用法 v-html 使用 v-html 指令用于输出 html 代码 v-mode 数据双向绑定 v-bind 元素属性绑定 v-on 元素事件绑定 v-if 条件绑定 v-for 循环绑定 文章来自 ww
阅读全文
摘要:子组件 <template><div> <h1>{{two}}</h1></div></template><script>export default { name: "Subcomp", props:['one','two'], data(){ return{ msg:'12121' } }}</
阅读全文
摘要:1.定义组件 <template> <div> <div class="one">确定</div> </div></template><script>export default { name: "Mybutton"}</script><style scoped>.one{ background:#
阅读全文
摘要:1,使用vuex createApp(App).use(store).use(router).mount('#app') 2,配置状态文件 export default createStore({ state: { num:5 }, mutations: { }, actions: { }, mod
阅读全文
摘要:<template><div> <h1>{{num}}</h1> <button @click="add">+</button> <input type="text" size="3" v-model="num"> <button @click="sub">-</button></div></tem
阅读全文
摘要:发起微信支付。 wx.requestPayment({ timeStamp: '', nonceStr: '', package: '', signType: 'www.cnmibee.com', paySign: '', success (res) { }, fail (res) { } })
阅读全文
摘要:每一个小程序页面也可以使用同名 .json 文件来对本页面的窗口表现进行配置,页面中配置项会覆盖 app.json 的 window 中相同的配置项。 { "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "bl
阅读全文
摘要:小程序根目录下的 app.json 文件用来对微信小程序进行全局配置,决定页面文件的路径、窗口表现、设置网络超时时间、设置多 tab 等。 以下是一个包含了部分常用配置选项的 app.json : { "pages": [ "pages/index/index", "pages/logs/index
阅读全文
摘要:总结四种Vue.js 安装方式 1,软件版本 我们可以在 Vue.js 的官网上直接下载 vue.min.js 并用 <script> 标签引入 2,使用 CDN 方法 CDN(国内) : https://cdn.staticfile.org/vue/2.2.2/vue.min.js 3,NPM 方
阅读全文