npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install -g @vue/cli
cnpm install
npm i --save ant-design-vue
cnpm run serve
或
cnpm run dev
git clone --depth=1 https://github.com/sendya/ant-design-pro-vue.git my-project
CD my-project
cnpm run build
App.vue 页面入口文件
main.vue 程序入口文件
permission.js 许可
components 组件
this.$router.push({ name: ‘index’ , query: {id: id}})
this.$router.push({ path: ‘index’,query: {id: 1,index:0}})
this.$router.replace({ path: ‘index’,query: {id: 1,index:0}})
this.$router.fullpath({ path: ‘index’,query: {id: 1,index:0}})
id: this.$route.query.id
window.location.reload();
window.location.href=‘URL’
this.$router.go(0);
Toast.success(‘成功文案’);
Toast.fail(“失败文案”)
// 延迟触发
setTimeout(() =>{
this.$router.go(-1)
},1000);
require(’@/assets/newimages/smllogo.png’)
1.在vue项目的index.html中添加如下代码
<meta name="format-detection" content="telephone=yes" />
2.在需要调起手机拨号功能的页面,写如下函数:
// 调用拨号功能
callPhone (phoneNumber) {
window.location.href = 'tel://' + phoneNumber
}
baseUrl: process.env.NODE_ENV === ‘production’ ? ‘/phone/dist/’ : ‘/’,
npm install vue-clipboard2 --save
import VueClipboard from “vue-clipboard2”;
import Clipboard from ‘clipboard’
[Clipboard.name]: Clipboard,
copy(){
var clipboard = new Clipboard('.tag-read')
clipboard.on('success', e => {
console.log('复制成功')
// 释放内存
clipboard.destroy()
})
clipboard.on('error', e => {
// 不支持复制
console.log('该浏览器不支持自动复制')
// 释放内存
clipboard.destroy()
})
},
export const getMemberInfo = ({id}) => {
return request({
url: '/wap/member/get_member_info',
method: 'POST',
data:{
id
}
})
}
async requestGetMemberInfo(params) {
try {
const res = await getMemberInfo(params);
return res;
} catch(error) {
console.log(error)
}
},
let params={
id : this.id
}
this.requestGetMemberInfo(params)
.then(res => {
if (res.errcode === 1) {
} else {
console.log(res.errmsg)
}
})
.catch(err => {
console.log(err)
})