- 博客(7)
- 收藏
- 关注
原创 vue webpack 设置别名
1.在vue项目中的src目录下的vue.config.js文件中设置别名 module.exports = { configureWebpack:{ resolve:{ alias:{ 'assets':'@/assets', //设置静态资源文件assets别名 'components':'@/components', //设置组件别名 'network':'@/network',
2021-09-24 11:40:02
776
原创 vue项目中使用vue-amap和高德地图原生Api
1.在官网进行注册 https://lbs.amap.com/ 2.在main.js中引入配置,按需引入插件 import VueAMap from 'vue-amap'; Vue.use(VueAMap) VueAMap.initAMapApiLoader({ // 高德的key key: 'af3036364576bf0fb5572996ef9f4850', // 插件集合 plugin:[ 'AMap.Autocomplete', 'AMap.PlaceSearch'
2021-09-16 09:15:02
1049
1
原创 vuex基础用法
store/index.js import { createStore } from 'vuex' import user from './module/user.js' const goods = { state:{ name:'750', type:'车机', }, getters:{ fullname(state){ return state.name+'+'+state.type }, fullname2(state,getters)
2021-09-14 16:29:07
99
原创 vue组合API结合路由
由于setup中无法访问this,因此无法直接访问this.$router或this.$route,我们使用useRoute和useRouter useRoute的参数改变又watch监听获取 示例: 路由文件:index.js // index.js { path: '/routerapi', name: 'RouterApi', // route level code-splitting // this generates a separate chunk (abou
2021-09-14 16:12:43
334
原创 vue3项目创建
vue3学习卸载vue之前版本安装vue3创建vue3项目1.目录结构2.运行打包 卸载vue之前版本安装vue3 1.卸载 npm uninstall vue-cli -g 卸载2.9.6版本时报错: 解决方式:cmd中输入 where vue 删除文件然后安装 2.安装 npm install -g @vue/cli 创建vue3项目 创建项目,项目名为demo1 vue create demo1 选择 Default (Vue 3) ([Vue 3] babel, eslint),默认带了两个
2021-09-14 10:21:25
79
原创 vue组合式API
组合式API 一.setup() 1.1setup()函数接受两个参数 setup在页面创建之前执行 1.props:父组件传过来的参数,响应式的,不能使用es6的解构赋值,否则会消除参数的响应性。如果要使用解构赋值,可以用setup中的toRefs() 注意setup中使用函数需要先引用 // import { toRefs } from 'vue' setup(props) { const { one} = toRefs(props) console.log(one.value) } //
2021-09-14 10:20:23
193
原创 javascript map fliter reduce
javascript 1.map 返回一个新数组,数组中的元素为原始数组元素调用函数处理后的值。 注意 map() 不会对空数组进行检测, 不会改变原始数组 语法:array.map(function(currentValue,index,arr), thisValue) 参数说明: 1.function(currentValue, index,arr):必须。函数,数组中的每个元素都会执行这个函数 函数参数: currentValue:必须,当前元素的值 index:可选。当前元素的索引值 arr:可选
2021-09-08 16:44:43
120
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人