LoginSignup
1
0

More than 3 years have passed since last update.

Vue.Use したのに動かない

Posted at

概要

  • Plugin を Vue.Use に渡したのに install が実行されていない挙動。
  • 原因は require, import の挙動の違い
  • 参考

require, import の違い

const Vue = require('vue')  // 1
import Vue from 'vue'       // 2
const { default: Vue } = require('vue') // 2 と同じ
  • 1 ではモジュール自体を Vue に格納している
const Vue = require('vue')  // 1
console.log(Vue)
Module {default: ƒ, __esModule: true, Symbol(Symbol.toStringTag): "Module"}
default: ƒ Vue(options)
Symbol(Symbol.toStringTag): "Module"
__esModule: true
__proto__: Object

エラーが出なかったのはなぜ

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0