You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
500 B

2 months ago
  1. const { switchVersion, loadModule } = require('./utils')
  2. const Vue = loadModule('vue')
  3. if (!Vue || typeof Vue.version !== 'string') {
  4. console.warn('[vue-demi] Vue is not found. Please run "npm install vue" to install.')
  5. }
  6. else if (Vue.version.startsWith('2.7.')) {
  7. switchVersion(2.7)
  8. }
  9. else if (Vue.version.startsWith('2.')) {
  10. switchVersion(2)
  11. }
  12. else if (Vue.version.startsWith('3.')) {
  13. switchVersion(3)
  14. }
  15. else {
  16. console.warn(`[vue-demi] Vue version v${Vue.version} is not supported.`)
  17. }