Я только что создал проект vue с помощью vue cli 3 с помощью этой команды:
vue create hello-world
Теперь я хотел бы использовать модуль util из Node.js ( этот ), но когда я использую код ниже, vue.js загружает свой собственный модуль. Я хотел бы загрузить оригинальный модуль утилиты node.js.
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
const originalNodeUtil = require('util');
const regEx = /test/;
if( originalNodeUtil.types.isRegExp(regEx))
console.log('Success');
export default {
name: 'home',
components: {
HelloWorld
}
}
</script>
Я начинаю с vue.js: - (
Thx