摘要: ue3转变 从 vue3 开始,由 setup 替代 vue2 data、methods、watch等 ,这样可以避免一个功能的代码逻辑拆分到各个属性中而变得难以阅读 vue3 setup 的这种写法可以更好的使用 TypeScript注意事项: setup 函数里面不可以使用 this, 因为se 阅读全文
posted @ 2021-09-30 15:47 熊大大001(前端开发) 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Ref <template> <h1>{{name}}</h1> <h1>{{age}}</h1> <button @click="sayName">按钮</button> </template> <script lang="ts"> import {ref,computed} from 'vue' 阅读全文
posted @ 2021-09-30 15:03 熊大大001(前端开发) 阅读(101) 评论(0) 推荐(0) 编辑
摘要: import {onMounted, ref} from 'vue' export default function useMouse() { let x = ref(0) let y = ref(0) onMounted(() => { window.addEventListener('mouse 阅读全文
posted @ 2021-09-30 14:58 熊大大001(前端开发) 阅读(2135) 评论(0) 推荐(0) 编辑
摘要: // useCount.js import {ref,reactive,computed} from 'vue' export default function useCount() { // 简单数据定义及使用 let count = ref(0) function addCount() { co 阅读全文
posted @ 2021-09-30 14:54 熊大大001(前端开发) 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 一、reactive reactive 用于为对象添加响应式状态。接收一个js对象作为参数,返回一个具有响应式状态的副本。 获取数据值的时候直接获取,不需要加.value 参数只能传入对象类型 import { reactive } from 'vue' // 响应式状态 const state = 阅读全文
posted @ 2021-09-30 14:41 熊大大001(前端开发) 阅读(323) 评论(0) 推荐(0) 编辑
摘要: // watch: { // 'form.timeScopes': function (val) { // console.log("进入吗?"); // console.log(val); // } // }, // computed: { // lossMinutes: function () 阅读全文
posted @ 2021-09-09 11:27 熊大大001(前端开发) 阅读(18) 评论(0) 推荐(0) 编辑
摘要: <div style="width:730px;"> <input type="text" id="search_name7" name="search_name" value="" style="display:none;"> <div style="height: 345px;margin-to 阅读全文
posted @ 2021-09-08 10:28 熊大大001(前端开发) 阅读(178) 评论(0) 推荐(0) 编辑
摘要: <template> <view v-for="(item, index) in Items" :key="index"> <image :src="item.imgUrl" mode="aspectFill" @error="error(index)"></image> </view> </tem 阅读全文
posted @ 2021-09-07 11:38 熊大大001(前端开发) 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 1、返回按钮 都请求接口 created() { window.addEventListener('pageshow', () => { //外链回退到vue应用要执行的代码 //this.pageshowGetData(); }) }, 2、引入相关js即可开发vue h5 3、helang-fl 阅读全文
posted @ 2021-08-23 10:40 熊大大001(前端开发) 阅读(169) 评论(0) 推荐(0) 编辑
摘要: onkeyup="this.value = this.value.replace(/[^\d.]/g,'').replace(/^\d{1,8}.\d{7,8}$/g,'');if(isNaN(this.value))this.value='';" onblur="if(this.value.sub 阅读全文
posted @ 2021-07-26 10:03 熊大大001(前端开发) 阅读(128) 评论(0) 推荐(0) 编辑