Closed wwwossai closed 3 years ago
it seems that the project name 'vue-plugin' already indicate that this is a vue plugin not component, which can only be installed using Vue.use and use global registration, according to the vue.js docs here。
The vue2 version exports component
also, though Vue 3 version does not. Perhaps that would work?
export default {
components: { 'highlightjs': hljsVuePlugin.component }
}
@joshgoebel yes it works! thanks for the help~~
@Trinovantes Is there a reason this export was removed from the Vue 3 version?
Just an oversight on my part. It should be fine to export for a local component
Would mind resolving maybe? 🙃
i read the docs for vue2, and can't find the locally regisered example, only the globally registered example. so i try it out, and failed. So is this plugin can only be registered globablly, or am i miss something?
i read the issue #1 , it seems related, but i'm using one single version of highlightjs 10.7.2, so i'm not quite clear whether or not this plugin supports locally register.
thanks.
NODE_MODULES
GOOD version (Globally registered):
BAD version (Registered in single file component):
errors in chrome console:
if i give a name,the error message change, but still cannot render the 'var x = 5'