上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 86 下一页
摘要: 一、基础 v-model 指令在表单 <input>、<textarea> 及 <select> 元素上创建双向数据绑定 1.文本 <div id="vm"> <input v-model="message" placeholder="edit me" /> <p>Message is: {{ me 阅读全文
posted @ 2021-06-16 14:47 富坚老贼 阅读(842) 评论(0) 推荐(0)
摘要: 1.属性监听 <div id="vm"> <button v-on:click="counter += 1">点击</button> <p>{{ counter }} times</p> </div> <script> const v = Vue.createApp({ data() { retur 阅读全文
posted @ 2021-06-16 14:12 富坚老贼 阅读(376) 评论(0) 推荐(0)
摘要: 一、条件渲染 1. v-if 通过表达式的真假来控制此标签是否显示 <div id="vm"> <!--awesome为真时显示此句--> <h1 v-if="awesome">Vue is awesome!</h1> <!--awesome为假时显示此句--> <h1 v-else>Oh no � 阅读全文
posted @ 2021-06-16 10:57 富坚老贼 阅读(427) 评论(0) 推荐(0)
摘要: 由于Class和Style绑定使用频繁,字符串拼接麻烦且易错。因此,Vue.js 做了专门的增强。表达式结果的类型除了字符串之外,还可以是对象或数组 一、Class isActive,isLine是bool值,用来控制该类是否有此名称 运行 (2)绑定类和非绑定类可以同时使用 (3)也可以把所有属性 阅读全文
posted @ 2021-06-16 09:32 富坚老贼 阅读(335) 评论(0) 推荐(0)
摘要: 一、计算属性 1.计算属性 计算方式不能复用,且不好维护 <div id="example"> {{ message.split('').reverse().join('') }} </div> 计算方式比较复杂或者重复使用时可以用计算属性 <div id="vm"> <div id="exampl 阅读全文
posted @ 2021-06-15 15:46 富坚老贼 阅读(116) 评论(0) 推荐(0)
摘要: 一、插值 1.Mustache 语法 html <span>Message: {{ msg }}</span> js <div id="vm">{{ msg }}</div> <script> Vue.createApp({ data(){ return { msg:'hello' } } }).m 阅读全文
posted @ 2021-06-15 13:54 富坚老贼 阅读(364) 评论(0) 推荐(0)
摘要: <script src="../node_modules/axios/dist/axios.js"></script> <script> //配置 const instance = axios.create({ //设置根路径 baseURL: 'http://localhost:5000/Test 阅读全文
posted @ 2021-06-14 15:54 富坚老贼 阅读(325) 评论(0) 推荐(0)
摘要: 引入 <script src="https://unpkg.com/axios/dist/axios.min.js"></script> get请求 //默认请求为get axios('http://localhost:5000/Test/g1') .then(function (response) 阅读全文
posted @ 2021-06-14 15:46 富坚老贼 阅读(847) 评论(0) 推荐(0)
摘要: 配置 <script src="../node_modules/axios/dist/axios.js"></script> <script> //配置 const instance = axios.create({ //设置根路径 baseURL: 'http://localhost:5000/T 阅读全文
posted @ 2021-06-14 15:45 富坚老贼 阅读(210) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-06-14 15:44 富坚老贼 阅读(33) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 86 下一页