Skip to content

Instantly share code, notes, and snippets.

View BojanKomazec's full-sized avatar
💭
DevOps Now!

Bojan Komazec BojanKomazec

💭
DevOps Now!
View GitHub Profile
<html lang="en">
...
<body>
...
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld.vue";
export default {
<template>
<div class="hello">
<h1>{{ msg }}</h1>
...
</div>
</template>
<script>
export default {
name: "HelloWorld",
// Define a new component called button-counter
Vue.component('button-counter', {
data: function () {
return {
count: 0
}
},
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
})
<script>
export default {
name: "HelloWorld",
props: {
...
}
};
</script>
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
}
>npm run serve
> example@0.1.0 serve C:\dev\github\the-vue-handbook-demo-cli-example\example
> vue-cli-service serve
INFO Starting development server...
98% after emitting CopyPlugin
DONE Compiled successfully in 4535ms
>npm run
Scripts available in example via `npm run-script`:
serve
vue-cli-service serve
build
vue-cli-service build
lint
vue-cli-service lint
> npm --version
6.4.1
> npm install -g npm@latest
C:\Users\komazec\AppData\Roaming\npm\npm -> C:\Users\komazec\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
C:\Users\komazec\AppData\Roaming\npm\npx -> C:\Users\komazec\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
+ npm@6.4.1
added 387 packages from 770 contributors in 35.656s