use-vue

1.0.4 • Public • Published

npm npm npm Travis CI bitHound Code Greenkeeper badge Twitter

use-vue

Declare use vue in Atom as use babel.

Getting started

$ npm install --save use-vue

Usage

import 'use-vue';
import app from './app.vue';
 
console.log(app);

CSP

CSP is Content Security Policy. In Atom, it would occur.

new Vue(app).$mount('app'); // CSP Error

You can import Vue from use-vue.

import { Vue } from 'use-vue';
import app from './app.vue';
new Vue(app).$mount('app');

Or, use loophole to avoid this problem.

import 'use-vue';
import Vur from 'vue'; // select the Vue version you want.
import app from './app.vue';
import { allowUnsafeNewFunction } from 'loophole';
 
allowUnsafeNewFunction(() => {
    new Vue(app).$mount('app');
});

Language

As Atom default, support this following language,

<script lang="ts">
    // code
</script>
 
<script lang="babel">
    // code
</script>
 
<script lang="coffee">
    // code
</script>
 
<style lang="less">
    // code
</style>

If you want to use any language else, you can register yourself. @see

License

MIT

Package Sidebar

Install

npm i use-vue

Weekly Downloads

2

Version

1.0.4

License

MIT

Last publish

Collaborators

  • lixinliang