传递给VUE构造函数的参数是什么?/

发布于 2025-02-01 14:40:35 字数 701 浏览 0 评论 0 原文

我完全是前端的新手,努力缠绕着我的头。

我在VUE中有一个问题,我无法在任何地方找到答案:这里的“ Vuetify”对象在VUE构造函数中意味着什么?我确实知道veutify是什么,但是为什么它传递给了Vue构造函数?

import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'

Vue.config.productionTip = false

new Vue({
  vuetify,
  render: h => h(App)
}).$mount('#app')

我已经检查了VUE文档 https://012.vuejs.s.s.org/api/api/options.html 每个选项都有其保留名称,例如数据方法等。但是没有通过第三方库或对象对其进行对象的定义。

有人可以帮我吗?

I'm totally a newbie in front end struggeling to wrap my head around it.

I have a question in Vue, for which I could't find answer anywhere: What does the 'vuetify' object here mean in the Vue constructor? I do know what veutify is, but why is it passed to the Vue constructor?

import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'

Vue.config.productionTip = false

new Vue({
  vuetify,
  render: h => h(App)
}).$mount('#app')

I have checked the Vue document https://012.vuejs.org/api/options.html
Every option has it's reserved name, like data, methods etc. But there are no definition of passing a 3rd party library or object to it.

Can anybody help me with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情深如许 2025-02-08 14:40:35

您可以传递自定义或第三方选项/库,以便可以在VUE应用程序中使用它们。这些选项可在 vm。$ options 中获得。

new Vue({
  customOption: 'foo',
  created: function () {
    console.log(this.$options.customOption) // -> 'foo'
  }
})

https:> https://012.vuejs.s.orgg/api/api/instance/instance -properties.html#vm- \ $ options

You can pass custom or 3rd-party options/libraries so you can use them in your Vue Application. Those options are available in vm.$options.

new Vue({
  customOption: 'foo',
  created: function () {
    console.log(this.$options.customOption) // -> 'foo'
  }
})

https://012.vuejs.org/api/instance-properties.html#vm-\$options

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文