1.0.0 • Published 2 years ago

vue-strict v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
2 years ago

vue-strict

Simple plugin for vue (and vue-cli in progress).

It lets you extract script (in ts) from a vue single-file components, to a separate file written in typescript.

Before

// component.vue
<template>
  <div>{{msg}} {{user}}</div>
</template>
<script>
export default {
	props : ['user'],
	data() {
		return {
			msg : 'Hello world'
		}
	}
}
</script>

After (in 2 files)

// component.vue
<template>
  <div>{{msg}} {{user}}</div>
</template>

// component.vue.ts
import { ComponentBase, prop } from 'vue-strict'
export default class extends ComponentBase {
	@prop
	public user : string;		
	private msg : string = "Hello world";
}

How to install

npm i vue-strict

Add modify your webpack config

  1. Webpack template

    module: { rules: [ { test: /.vue$/, use: { loader: 'vue-loader', options: vueLoaderConfig },{ loader : 'vue-strict' } },

  2. Vue cli based projects, sample vue.config.js

    var path = require('path')

    module.exports = { chainWebpack: config => { config.module .rule('vue') .use('vue-strict') .loader('vue-strict'); },

    baseUrl: undefined,
    outputDir: undefined,
    assetsDir: undefined,
    runtimeCompiler: true,
    productionSourceMap: undefined,
    parallel: undefined,
    css: undefined

    }

1.0.0

2 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago