是否可以将 vuetify 添加到默认 vuepress 主题?
我只需要向默认主题添加一些组件,但是使用 vuetify 来处理组件中的表单会很好。
我找到了一个使用 vuetify 的自定义 vuepress 主题,但我更喜欢使用默认的 vuepress 主题。
另一种选择是弹出默认主题并将 vuetify 添加到其中。不过我不想弹出默认主题,只需添加 vuetify 即可。
The 之前的回答 https://stackoverflow.com/a/53199908/10577234 from oscarteg https://stackoverflow.com/users/3714327/oscarteg让我大部分时间都到了那里。这就是我必须做的.vuepress/enhanceApp.js
文件(是的,如果您没有,请继续创建它)。
import Vuetify from "vuetify";
import "vuetify/dist/vuetify.min.css";
export default ({
Vue, // the version of Vue being used in the VuePress app
options, // the options for the root Vue instance
router, // the router instance for the app
siteData // site metadata
}) => {
Vue.use(Vuetify);
options.vuetify = new Vuetify({})
};
请注意,在new Vuetify({})
传递给options.vuetify
你可以设置你的主题。
See https://github.com/vuejs/vuepress/issues/681#issuecomment-515704018 https://github.com/vuejs/vuepress/issues/681#issuecomment-515704018
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)