keep-alive内置组件的incluede属性失效? #10940
Unanswered
Liu-code3
asked this question in
Help/Questions
Replies: 1 comment 1 reply
-
我使用了onUnmounted、onActivated、onDeactivated这三个生命周期函数放在两个组件中测试了一下,并且在两个组件中的<script setup name="login">,<script setup name="demo"> 这样就没问题了;然后我把组件中的script标签上的name删除后,也没有问题了。和我提出问题时候的代码环境一样了,但是这样也没问题了。搞得我更加疑惑了,真心恳请大佬解惑。 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
如下是我在 App.vue使用 keep-alive组件
如下是我路由文件
https://cn.vuejs.org/guide/built-ins/keep-alive.html中有个Tip: 在 3.2.34 或以上的版本中,使用 <script setup> 的单文件组件会自动根据文件名生成对应的 name 选项,无需再手动声明。
我现在的Vue版本是3.4.21 组件名字与include属性的值是一样的
恳请大佬解惑一下
Beta Was this translation helpful? Give feedback.
All reactions