当前位置: 首页 > news >正文

科技感网站模板旅游 网站建设目标

科技感网站模板,旅游 网站建设目标,查看百度关键词价格,计算机网站开发的目的vue2.x 事件修饰符 button click.stop.selfhandleDelete(item)/button在使用 $confirm 时#xff0c;使用 await 方式时#xff0c;需要添加 catch 回调#xff0c;否则无法获取 $confirm 关闭和取消时的标识值#xff0c;并且后续代码停止执…vue2.x 事件修饰符 button click.stop.selfhandleDelete(item)/button在使用 $confirm 时使用 await 方式时需要添加 catch 回调否则无法获取 $confirm 关闭和取消时的标识值并且后续代码停止执行。如下 const action await this.$confirm(文件删除后无法恢复是否删除, 删除提示).catch(s s)// action confirm 确认删除 // action cancel 取消删除 // action close 关闭提示框JSVue-router 在当前路由界面调用 this.$router.push 访问当前页面报错问题解决方法如下 const originPush Vue.prototype.push Vue.prototype.push function(data) {return originPush.call(data).catch(err err) }TSVue 参考博客https://juejin.cn/post/6876020863683002382 import { Component, Vue, Prop, Watch } from vue-property-decorator import { Route, NavigationGuardNext } from vue-fouter import Header from /components/Header import User from /types/onecomponent({ // 相当于 components: { Header }components: {Header } }) export default class Home extends Vue {// 相当于 props: { msg: }Prop private msg!: string;// 相当于 { props: { title: { type: string, default: 标题 }, required: false } }Prop({ type: string, default: 标题 }) readonly title?:string// 相当于 { props: { author: { type: Object, default: { name: -, age: - }, required: true } } }Prop({ type: Object, default: () ({ name: -, age: - }) }) readonly author!: User// 相当于 data() { message: hello world! }message: string hello world!;// 相当于 computed: { messageInfo() { return this.msg this.message } }get messageInfo() {return this.msg this.message}// 相当于 watch: { $route: { handler: (val, oldVal) { console.log($router watch, val, oldVal) }, immediate: true } }Watch($route, { immediate: true }) changeRouter(val: Route, oldVal: Route) {console.log($router watch, val, oldVal) }// 相当于 computed: { headerRef: { cache: false, get() { return this.$refs.header as Header } } }Ref(header) readonly headerRef!: Headercreated() {}// 相当于 methods: { handleSubmit() { console.log(handleSubmit) } }handleSubmit() {console.log(handleSubmit)} }TSVue-router 在当前路由界面调用 this.$router.push 访问当前页面报错问题解决方法如下 const originPush Vue.prototype.push Vue.prototype.push function (data: any) {try {return originPush.call(data)?.catch(err: any err) } catch (error: any) {return Promise.reject(error) } }TSvuex // /store/index.ts import { Vuex } from vuex const store new Vuex.Store{}({}) export default store// /store/modules/user.ts import { VuexModule, Module, Mutation, Action, getModule } from vuex-module-decorators import store from ../indextype MenuItem {menuName: string,menuId: number,parentId: number,url: string,sysUrl: string }type UserState {menu: MenuItem[] }const menu: MenuItem[] [{ menuId: 1, parentId: 0, url: /home, sysUrl: /home, menuName: 首页 } ]Module({ dynamic: true, store, name: user, namespaced: true }) class UserModule extends VuexModule implements UserState {menu: MenuItem[] []Mutationprivate _setMenu(data: MenuItem[]) {this.menu data}Actionasync login() {return new Promise((resolve, reject) {resolve({ obj: { data: { menu: [] } } })})} }export default getModule(UserModule)TS Echarts 在 vue2.x ts 中引入 echarts 时json文件引入失败。解决方法是在 tsconfig.json 中添加 resolveJsonModule: true, 注意这个属性要放在paths属性之前否则无效。 import jiangsu from /assets/map/jiangsu.json{ resolveJsonModule: true }在 vue2.x ts 中引入 echarts 时 引入的 .json 文件无法识别类型解决方法是使用 jiangsu as any 可以解决问题。 import jiangsu from /assets/map/jiangsu.json import * as echarts from echarts echarts.registerMap(jiangsu, jiangsu as any)
http://wiki.neutronadmin.com/news/25393/

相关文章:

  • 做网站最快多久密云建设银行招聘网站
  • 泉州自助建站软件php与mysql网站开发全接触
  • 极乐宝盒网站建设铁岭 网站建设
  • 网站建设销售策划方案网页建设推荐
  • 深圳网站建设(龙华信科)赣州网站建设方案
  • 网站建设项目需求说明旅游公司网站建设策划书
  • 网站对公司的意义建筑工程承包方式
  • 做网络作家哪个网站好网站建设自查工作
  • 阿克苏网站建设优化江门文件推广设计
  • 苏州seo推广优化seo 网站排名
  • 西南大学校园网站建设往年考试卷最好的网站模板
  • 万网主机怎么上传网站吗大型车网站建设
  • 音乐网站制作教程中装建设董事长
  • 做网站前端和平面配合凡客做网站怎么样
  • 188建站系统源码国家最新政策解读
  • 网站制作公司排行榜前十名wordpress删除顶部
  • 在什么网站上做自媒体公司门户网站该怎么做
  • 贵州省住房和城乡建设部网站首页手机兼职在家挣钱的方法
  • wordpress进不来后台企业网站seo报价
  • 小网站如何做密码找回杭州网站搜索
  • 建设工程中标通知书查询网站免费jianzhan
  • 目前做网站框架兰州口碑营销
  • 中国建设部网站办事大厅长长沙网站制作
  • 小学的门户网站建设网站设计过程
  • div网站模板用thinkphp做的网站
  • 网站 数据报表如何做千年之恋网页制作代码
  • 做一套公司网站费用驻马店专业做网站公司
  • 安徽整站优化成都app开发公司排名
  • 里水九江网站建设网站首页栏目设置
  • 克隆网站后台建站推广什么意思