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

做网站收录厦门网站seo

做网站收录,厦门网站seo,苏州模板网站专业设计,威海建设招聘信息网站经过几个小时的努力&#xff0c;终于实现了&#xff0c;根据组件名异常加载组件&#xff0c;直接上代码&#xff0c;网上的很多代码方都有坑&#xff0c;先贴出比较坑的代码&#xff1a; <template><view class"main"> <view class"tops"…

经过几个小时的努力,终于实现了,根据组件名异常加载组件,直接上代码,网上的很多代码方都有坑,先贴出比较坑的代码:

<template><view class="main">		<view class="tops"><view class="info"><view class="item"><view class="tit">姓名:</view><view class="txt">{{qyUser.name}}</view></view></view></view><view><component :is="dycomp" v-if="isShow"></component></view></view>
</template>
<script setup>
import {  ref, defineAsyncComponent,markRaw } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import api from '../../api/api.js';
const qyUser = ref({});
//markRaw方法将组件对象标记为非响应式对象
//shallowRef代替ref来创建一个浅响应式对象
const dycomp = ref(null);
const isShow = ref(false);
onLoad(()=>{geQyUserInfo();loadAsyncComponent("mdIndex");	
});
const loadAsyncComponent = (componentName)=>{console.log(componentName);dycomp.value = defineAsyncComponent(() =>{import("../components/"+componentName+".vue");});isShow.value = true;}
const geQyUserInfo = ()=>{console.log(uni.getStorageSync("qyuserid"));api.geQyUserInfo({"qyuserid":uni.getStorageSync("qyuserid"),},(res)=>{qyUser.value = res.data.qyUser;	});
}
</script>
<style lang="scss" scoped>.main {background-color: #f5f6f8;width: 100%;height: 100vh;box-sizing: border-box;padding: 20rpx;.tops {background: #fff;border-radius: 20rpx;padding: 20rpx 20rpx 10rpx;.title {margin-bottom: 25rpx;border-left: 6rpx solid #1296db;padding-left: 10rpx;}.info {.item {display: flex;align-items: center;font-size: 26rpx;margin-bottom: 10rpx;.tit {flex: 1;color: #666;}.txt {flex: 4;}}}}}
</style>

最后优化后成功异步加载组件的代码:

<template><view class="main">		<view class="tops"><view class="info"><view class="item"><view class="tit">姓名:</view><view class="txt">{{qyUser.name}}</view></view></view></view><view><component :is="dycomp" v-if="isShow"></component></view></view>
</template>
<script setup>
import {  ref, defineAsyncComponent,markRaw,shallowRef } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import api from '../../api/api.js';
const qyUser = ref({});
//markRaw方法将组件对象标记为非响应式对象
//shallowRef代替ref来创建一个浅响应式对象
const dycomp = shallowRef(null);
const isShow = ref(false);
onLoad(()=>{geQyUserInfo();});
const loadAsyncComponent = (componentName)=>{console.log(componentName);dycomp.value = defineAsyncComponent({loader: () => import("../../components/"+componentName+".vue"),delay: 200,timeout: 3000});isShow.value = true;}
const geQyUserInfo = ()=>{api.geQyUserInfo({"qyuserid":uni.getStorageSync("qyuserid"),},(res)=>{qyUser.value = res.data.qyUser;loadAsyncComponent("mdIndex");});
}
</script>
<style lang="scss" scoped>.main {background-color: #f5f6f8;width: 100%;height: 100vh;box-sizing: border-box;padding: 20rpx;.tops {background: #fff;border-radius: 20rpx;padding: 20rpx 20rpx 10rpx;.title {margin-bottom: 25rpx;border-left: 6rpx solid #1296db;padding-left: 10rpx;}.info {.item {display: flex;align-items: center;font-size: 26rpx;margin-bottom: 10rpx;.tit {flex: 1;color: #666;}.txt {flex: 4;}}}}}
</style>
http://www.ds6.com.cn/news/54500.html

相关文章:

  • 物流企业网站织梦模板百度移动端排名软件
  • 做网站找个人百度平台推广联系方式
  • 四川省建设勘察设计网站软文代写兼职
  • 企业网站功能jsurl中文转码
  • 网站备案修改域名ip百度指数数据分析平台官网
  • 葫芦岛公司做网站如何注册域名及网站
  • 制作网站开发元搜索引擎有哪些
  • 网站建设综合技术如何建造自己的网站
  • 公众号链接电影网站怎么做企业qq怎么申请
  • 我的网站模板下载不了站长工具星空传媒
  • 手机登录网站怎么建设重庆seo入门教程
  • 黑别人网站谷歌网站网址
  • 公路水运建设质量安全监督网站网站注册账号
  • 全国城乡和住房建设厅查询网seo服务优化
  • 网站优化排名如何做网店代运营骗局
  • 专业做网站的网站正规推广平台
  • wordpress上传文件按标题seo关键词
  • 国外网站dns在线解析绍兴seo排名公司
  • php网站权限设置必应搜索推广
  • 网站建设与制作与维护西安百度搜索排名
  • 外贸网站图片阿里巴巴国际贸易网站
  • 有哪些网站可以做全屏代码如何创造一个自己的网站
  • 跨境电商怎么做一件代发seo工具优化软件
  • 什么网站专门做境外当地游广州最新新闻
  • 网站建设新闻动态搜索引擎营销的主要模式
  • 网站注册域名后怎么做营业推广策略有哪些
  • 开发网站建设百度app关键词优化
  • 怎么建立企业网站平台如何自己开网站
  • 网站建设公司平台注册一个网站
  • 网站内页检测b2b有哪些电商平台