Starter template example for Vue2 + Typescript + Vite.
Note: Using pnpm for package manager.
pnpm install
pnpm run serve
pnpm run build
pnpm run lint
Vue2 with typescript and vite starter template
Home Page: https://martinussuherman.github.io/vue-template/
License: MIT License
Starter template example for Vue2 + Typescript + Vite.
Note: Using pnpm for package manager.
pnpm install
pnpm run serve
pnpm run build
pnpm run lint
CodeFactor found an issue: Trailing spaces
It's currently on:
.github\workflows\gh-pages.yml:19
Hey @martinussuherman,
Thanks for putting this together, I know this is just your template and has nothing to do with this repo, but wanted to get your take as maybe there's some kind of version issue here.
If you try to set a class property to a Vue property the class property will not be set. This is not the case when bundling with webpack (or other methods).
Example:
<template>
<div>
<p>This works: {{ test }}</p>
<p>This also works: {{ thisWorks }}</p>
<p>This doesnt: {{ thisDoesnt }}</p>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
@Component
export default class TestComponent extends Vue {
@Prop({ default: "WORKS" }) input !: string;
thisWorks = "WORKS!";
thisDoesnt = this.input;
}
</script>
I've been spelunking in vue-property-decorator, but I can't see any reasoning for the change of behaviour. It seems likely that this may be a bug in esbuild, but would love to get your take.
Should note that defining the prop in the @component decorator works correctly, which is what made me focus on the the property decorator.
Someone also opened an issue with this in vite-plugin-vue2: underfin/vite-plugin-vue2#124 but I also don't think it's an issue with that.
Opening this issue here, so others see it if they are using this template.
Hi,
Running 'npm install' and 'npm run dev' gives
[vite] Internal server error: Unexpected string
Plugin: vite:css
File: /home/marius/work/vue-template/src/App.vue?vue&type=style&index=0&lang.scss
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at importFresh (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:5931:47)
at loadJs (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15294:18)
at Explorer.loadFileContent (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15777:32)
at Explorer.createCosmiconfigResult (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15782:36)
at Explorer.loadSearchPlace (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15763:31)
at async Explorer.searchDirectory (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15748:27)
at async run (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15728:22)
at async cacheWrapper (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15580:18)
at async cacheWrapper (/home/marius/work/vue-template/node_modules/vite/dist/node/chunks/dep-6e02b235.js:15580:18)
I don't have pnpm
in order to try it too. I understand that pnpm
is faster, but the project should still work with npm
, right?
I'm not sure this is a npm issue or a vue-template setup issue.
Hi,
Line 11 in e900f9c
why is core-js needed? It's not imported anywhere.
If needed, maybe should be in devDependencies
?
Line 29 in e900f9c
Just sass
should be enough: https://vitejs.dev/guide/features.html#css-pre-processors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.