<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>代码人 - Vue</title>
    <link>https://www.daimaren.com/forum.php?mod=forumdisplay&amp;fid=18</link>
    <description>Latest 20 threads of Vue</description>
    <copyright>Copyright(C) 代码人</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Wed, 22 Apr 2026 16:46:44 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>https://www.daimaren.com/static/image/common/logo_88_31.gif</url>
      <title>代码人</title>
      <link>https://www.daimaren.com/</link>
    </image>
    <item>
      <title>TypeError: Cannot read properties of undefined (reading \'data\')     at Object.po</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=321</link>
      <description><![CDATA[1.页面加载，接口POST请求，报错：



错误1：请求返回空响应   ...index.ts:34  【src/config/axios/index.ts】



错误2：POST请求失败: TypeError: Cannot read properties of undefined (reading \'data\')    at Object.post 















错误1：Uncaught (in pr ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Thu, 04 Dec 2025 02:01:59 +0000</pubDate>
    </item>
    <item>
      <title>vue3+ts项目开发笔记</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=320</link>
      <description><![CDATA[[kkpay=300]
//字典 begin
const optionsROOM_APPLICATION = ref([])
const getDictData = () =&gt; {
  let dictTypes = [\'ROOM_APPLICATION\']
  getSimpleDictItemList({ dictTypes: dictTypes, pageSize: 1000 })
    .then((response) =&gt; {
      if (response.lengt]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Wed, 12 Nov 2025 08:51:15 +0000</pubDate>
    </item>
    <item>
      <title>Uncaught (in promise) TypeError</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=319</link>
      <description><![CDATA[Uncaught (in promise) TypeError: Cannot read properties of undefined (reading \'data\')
    at Object.get (index.ts:25:16)
    at async Module.getUnreadNotifyMessageCount (index.ts:48:10)]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Tue, 11 Nov 2025 02:29:14 +0000</pubDate>
    </item>
    <item>
      <title>router.beforeEach 获取路由的参数值</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=317</link>
      <description><![CDATA[在 Vue Router 的 beforeEach 导航守卫中，可以通过 to 参数获取目标路由的各种参数值。

一、路由参数获取方式
1.动态路由参数‌：通过 to.params 对象获取 URL 路径中的参数：


2.查询参数‌：通过 to.query 对象获取 URL 中 ? 后面的参数：

来源：百度AI

 ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Fri, 31 Oct 2025 09:41:17 +0000</pubDate>
    </item>
    <item>
      <title>vue3+ts url不带/可以正常访问,带/就会提示404解决办法</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=308</link>
      <description><![CDATA[出现404时，通常与路由配置或服务器设置有关。以下是解决方案：

const routes = [
  {
    path: \'/oss\',  // 不带斜杠
    component: OssComponent
  },
  {
    path: \'/oss/\', // 带斜杠
    component: OssComponent
  }
]

来源：百度AI ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Fri, 25 Jul 2025 10:59:31 +0000</pubDate>
    </item>
    <item>
      <title>watch监测form表单的长和宽的字段，动态计算面积</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=306</link>
      <description><![CDATA[vue3+ts使用watch监测form表单的长和宽的字段，按长和宽的字段的动态输入，用watch动态计算面积.
实例代码：[kkpay=1]

[/kkpay]]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Fri, 11 Jul 2025 01:43:31 +0000</pubDate>
    </item>
    <item>
      <title>vue3的tags页面标签跳转的同时关闭标签</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=287</link>
      <description><![CDATA[vue3的tags标签关闭的操作代码：
[kkpay=3]


import { useTagsViewStore } from \'@/store/modules/tagsView\'

const {currentRoute} = useRouter() // 路由
const {delView} = useTagsViewStore() // 视图操作

const cancleClick = () =&gt; {
  delView(unref(currentRo ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Wed, 16 Apr 2025 06:21:54 +0000</pubDate>
    </item>
    <item>
      <title>vue3页面标签&lt;template&gt;,&lt;script&gt;,&lt;style&gt;顺序</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=286</link>
      <description><![CDATA[核心规则说明‌

‌1. 必须在前‌

作为组件的结构层，应优先声明 HTML 模板，符合从视觉结构到逻辑行为的阅读顺序。
唯一例外：若使用  语法糖，可允许  前置（但非官方推荐）。
‌
2. 在中间‌

逻辑层代码紧随模板层，方便开发时快速定位与模板关联的响 ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Wed, 16 Apr 2025 06:19:52 +0000</pubDate>
    </item>
    <item>
      <title>vue3-count-to实现数字动态增长</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=267</link>
      <description><![CDATA[一、安装 vue3-count-to

1.首先，你需要安装 vue3-count-to 包：

或者使用 yarn:


二、vue3-count-to属性

vue3-count-to 提供了一些常用的属性来控制动画效果：

start-val: 起始值（默认为 0）。
end-val: 目标数字（必选项）。
duration: 动画时长（单位：毫秒） ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Tue, 04 Mar 2025 02:56:55 +0000</pubDate>
    </item>
    <item>
      <title>vue清空el-table的选择</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=256</link>
      <description><![CDATA[清空


[kkpay=1]

const multipleTableRef = ref()
const tableDataYMZYGL = ref([])
const multipleSelectionYMZY = ref([])

const ymzyChange = (val) =&gt; {
  multipleSelection_YMZY.value = val
}

//清空操作
const clearTableSelection ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Thu, 06 Feb 2025 03:57:55 +0000</pubDate>
    </item>
    <item>
      <title>vue标签el-form-item被隐藏，表单校验失效怎么办</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=255</link>
      <description><![CDATA[在Vue中使用Element UI，标签el-form-item被隐藏，表单校验失效。以下是解决方案之一：
[kkpay=1]
把v-if‌改为v-show：
        如果你使用v-if来隐藏el-form-item，那么当条件为false时，该组件将完全不会被渲染，因此其校验也会失效。当改用v-show时，可以保持组件 ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Fri, 24 Jan 2025 09:02:42 +0000</pubDate>
    </item>
    <item>
      <title>dialog-footer 按钮居中展示</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=254</link>
      <description><![CDATA[操作的css：
[kkpay=1]

[/kkpay]]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Wed, 22 Jan 2025 09:11:37 +0000</pubDate>
    </item>
    <item>
      <title>vue tabs切换 echars不展示</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=250</link>
      <description><![CDATA[方法：
可以在切换tabs时，重新再请求echars初始化的函数就行。]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Sat, 18 Jan 2025 13:12:15 +0000</pubDate>
    </item>
    <item>
      <title>vue请求接口时， 清除参数对象中为空值的属性</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=243</link>
      <description><![CDATA[1.建一个公用的ts文件paramsDoNull.ts，路径举例为：src/utils/paramsDoNull.ts

实现方法：
[kkpay=3]

2.在业务所在的页面引用


import {removeParamsNull} from \'@/utils/paramsDoNull\'
......

/** 提交表单 */
const submitForm = async () =&gt; {
  // 校验表单
   ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Thu, 09 Jan 2025 11:00:36 +0000</pubDate>
    </item>
    <item>
      <title>el-table列表点击操作中的编辑，vue弹框动态赋值</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=242</link>
      <description><![CDATA[1.


[kkpay=1]
2.

//弹框字段定义
const formData = reactive({
  ossCode: \'\',
  buildingCode: \'\',
  roomCode: \'\',
  rackCode: \'\',
  powerAb: \'\'
})




[/kkpay]

相关：

.hasOwnProperty()是什么？

答：hasOwnProperty‌是JavaScript中的一个内置方法，用于]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Thu, 09 Jan 2025 08:23:20 +0000</pubDate>
    </item>
    <item>
      <title>vue动态修改路由的meta.title</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=241</link>
      <description><![CDATA[vue项目开发中，当前页面跳转到新页面时，需要按打开类型跳转到二级页面，二级页面的title需要按类型进行修改，动态展示。

[kkpay=1]1.点击跳转时，就要给路由添加参数，赋值跳转的类型：


2.二级页面add.vue，添加修改meta.title的事件：



[/kkpay] ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Wed, 08 Jan 2025 02:01:48 +0000</pubDate>
    </item>
    <item>
      <title>vue3 新建页面时发现script标签放在最上面，为什么？</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=240</link>
      <description><![CDATA[Vue 3中将script标签放在上方的原因有以下几点：

    1.解决表达式依赖问题：在Vue 3之前的版本中，script标签通常放在HTML的最底部，以确保页面元素都已经加载完毕。然而，这在涉及到表达式依赖的情况下会产生问题。因为Vue在解析模板时是从上到下的顺序进行的， ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Tue, 07 Jan 2025 01:49:51 +0000</pubDate>
    </item>
    <item>
      <title>vue3 介绍</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=239</link>
      <description><![CDATA[Vue 3 介绍

    Vue3 于 2022 年 2 月 7 日星期一成为新的默认版本！
    Vue3 性能更高，体积更小
    Vue3 在经过一年的迭代后，越来越好用。

官方文档：

    vue3官方文档：vuejs.org/
    vue3中文文档：v3.cn.vuejs.org/
    vue3预发布版文档：staging-cn.vuej ...]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Tue, 07 Jan 2025 01:46:32 +0000</pubDate>
    </item>
    <item>
      <title>vue 标签打印，打印二维码弹框前端代码</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=238</link>
      <description><![CDATA[]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Mon, 06 Jan 2025 11:05:49 +0000</pubDate>
    </item>
    <item>
      <title>vue3跳转页面参数router.query找不到显示undefined</title>
      <link>https://www.daimaren.com/forum.php?mod=viewthread&amp;tid=227</link>
      <description><![CDATA[问题：vue3 没有 router.query ？

解决：
不能router直接query。应该这么写：[kkpay=3]

1.先引入router


import { useRouter } from \'vue-router\' 
const router = useRouter() 




2.找到query是方法：

[/kkpay]]]></description>
      <category>Vue</category>
      <author>dmr</author>
      <pubDate>Tue, 10 Dec 2024 09:01:05 +0000</pubDate>
    </item>
  </channel>
</rss>