This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
还剩{{balance}} | |
<button @click="handleClick">我要花我爷爷给我的钱</button> | |
</div> | |
</template> | |
<script> | |
export default { | |
inject: ['eventBus'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose') | |
// ES6 | |
mongoose.Promise = global.Promise | |
// Connect to the db before tests run | |
before(done => { | |
// Connect to mongodb | |
mongoose.connect('mongodb://localhost/testaroo', { | |
useNewUrlParser: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
export default { | |
data() { | |
return { | |
currentDiv: null | |
} | |
}, | |
methods: { | |
createDiv() { | |
if (!this.currentDiv) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$nextTick(() => { | |
this.$refs.line.style.height = getComputedStyle(this.$refs.wrapper).height | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const env = process.env.NODE_ENV // 环境参数,是在 npm script 里设置的 | |
let MYSQL_CONF | |
let REDIS_CONF | |
if (env === "dev") { | |
// mysql | |
MYSQL_CONF = { | |
host: "localhost", | |
user: "root", |