扫描网站漏洞的软件,网站收录做关键词排名,亿客搜网站建设,做网站如何计算工资1. [Vue warn]: inject() can only be used inside setup() or functional components. 这个消息是提示我们#xff0c;需要将引入的方法作为一个变量使用。以vue-store为例#xff0c;如果我们按照如下的方式使用#xff1a;
import UseUserStore from ../../store/module…1. [Vue warn]: inject() can only be used inside setup() or functional components. 这个消息是提示我们需要将引入的方法作为一个变量使用。以vue-store为例如果我们按照如下的方式使用
import UseUserStore from ../../store/modules/userconst role UseUserStore ().role就会提示如上错误。但是如果我们按照这样的方法使用就不会报错了。
import UseUserStore from ../../store/modules/userconst userStore UseUserStore()
const role userStore.role2. [Vue warn]: Component inside renders non-element root node that cannot be animated. 这个warn是提示您组件中的渲染元素没有全部包裹在一个div中就像下面这样的 只需要将这几个引入的足迹放在根div标签内即可 当我们将渲染元素全部放在同一个div内就没有warn提示了。