在vue中啟用、清除timeout的寫法不同,如果clearInterval沒有加上window,就不會停止。
setTimeout可以直接使用:
this.timeout = setTimeout(() => {
console.log('一小時後要做的事');
}, 1000 * 60 * 60);
mac使用iTerm2 的agnoster主題,想要手動修改一些設定,但是.bashrc檔案中卻沒有相關參數可以隱藏。
開發vue專案,想要生成一段網址可以貼給別人預覽。
先在vue.config.js中加入plugin定義
var webpack = require("webpack");
module.exports = {
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
在製作網站時,有時候需要資料的傳輸、紀錄,可是又沒有後端技術,可以使用firebase的database、登入等服務來達到建立資料庫、增刪查改的功能。
在使用cli3 搭配 yarn serve時,自動打開該port號的視窗。
方法一:
在package.json檔案中設定
{
"scripts": {
"serve": "vue-cli-service serve --open --mode local"
方法1:
const paddingZeroLeft = (str, length) => {
if(typeof (str) !== "string"){
str = str + "";
}
if (str.length >= length){