This file contains 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
modules: [ | |
'bootstrap-vue/nuxt', | |
'@nuxtjs/axios', | |
'@nuxtjs/proxy' | |
], | |
axios: { | |
proxy: true, | |
prefix: '/api', | |
credentials: true, | |
}, |
This file contains 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
modules: [ | |
'@nuxtjs/axios', | |
'@nuxtjs/proxy' | |
], | |
axios: { | |
proxy: true, | |
prefix: '/api', | |
credentials: true, | |
}, | |
proxy: { |
This file contains 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
export default function ({ $axios, redirect }) { | |
//Authorization | |
$axios.setHeader('Content-Type', 'application/json') | |
} |
This file contains 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
plugins: [ | |
'~/plugins/axios' | |
], |
This file contains 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
var licenseKeyFormatting = function(S, K) { | |
let str = S.replace(/-/g, "").toUpperCase() //去除"-"並改成大寫 | |
let result = '' //每次迴圈跑完就對這個空字串添加字符 | |
let countK = 0 | |
for(let i =str.length-1; i >= 0; i--) { //由後往前遍歷字串,起始點是最後一個字,終點是第0個字 | |
letter = str[i] | |
result += letter | |
countK ++ | |
if(countK == K){ //如果剛好加到第 K 個,就要再加上"-" |
This file contains 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> | |
import { Line, mixins } from 'vue-chartjs' | |
const { reactiveProp } = mixins | |
export default { | |
mixins: [reactiveProp], | |
extends: Line, | |
props: { //待會會從父組件傳入圖表資料 | |
chartData: { | |
type: Object, |
This file contains 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> | |
import { Line } from 'vue-chartjs' | |
export default { | |
extends: Line, | |
props: { //待會會從父組件傳入圖表資料 | |
chartData: { | |
type: Object, | |
default: () => {} | |
} |
This file contains 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
{ | |
labels: ['今天', '昨天', '一週前'], // 位於 x 軸的各筆數據 key | |
datasets: [ | |
{ | |
label: '排名', // x 軸的標籤項目 | |
backgroundColor: 'rgba(0,0,0,0.1)', | |
data: ['1', '2', '1'] // 位於 y 軸對應的各筆數據 value | |
} | |
] | |
} |
This file contains 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> | |
import { Line, mixins } from 'vue-chartjs' | |
const { reactiveProp } = mixins | |
export default { | |
mixins: [reactiveProp], | |
extends: Line, | |
data: () => ({ | |
options: { | |
responsive: true, |
This file contains 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
.grid-cell { | |
display: flex; | |
align-items: flex-end; | |
flex-wrap: wrap; // 讓內部 div 當空間不夠時可以自動換行 | |
flex-direction: column; // 讓內部 div 由上往下排列 | |
justify-content: space-between; // 讓內部的 div 內容可以去均分父元素橫的空間 | |
align-content: space-around; // 讓內部的 div 內容可以去均分父元素直的空間 | |
height: 350px; // 要設定固定高度,才會有 wrap 的效果 | |
} |
OlderNewer