VUE

常用軟體,程式語言的筆記和疑問
Forum rules
盡量做到:
每一個貼子都精心編輯;
每一個疑問都得到解答。
ejsoon
Site Admin
Posts: 3767
Joined: 2016 Jan 10, 22:15

幾個VUE後臺

Post by ejsoon » 2018 Apr 26, 10:03

朋友介紹的:
https://github.com/PanJiaChen/vue-element-admin

首頁餅圖一直在轉的:
https://github.com/vue-bulma/vue-admin

這個好像和vue沒有太大關係:
https://github.com/coreui/coreui-free-b ... n-template

很老一篇文章提的:
https://github.com/taylorchen709/vue-admin

ejsoon
Site Admin
Posts: 3767
Joined: 2016 Jan 10, 22:15

npm install參數說明

Post by ejsoon » 2018 Apr 26, 10:48

https://blog.csdn.net/u011565547/articl ... s/79646075

一般加上--save也就可以了。

ejsoon
Site Admin
Posts: 3767
Joined: 2016 Jan 10, 22:15

VUE axios跨域和攔截器

Post by ejsoon » 2018 Apr 26, 11:44


ejsoon
Site Admin
Posts: 3767
Joined: 2016 Jan 10, 22:15

VUE Element

Post by ejsoon » 2018 Apr 27, 10:25

Code: Select all

      <el-pagination background layout="prev, pager, next"
        :current-page.sync="datacrtpage"
        :total="datattlpage" @current-change="getdata"></el-pagination>
为什么current-page要加.sync,而total不用呢? 因爲是反向驅動,如同v-model(並不準確,僅作理解)。正解在
<comp :foo.sync="bar"></comp>會拓展爲<comp :foo="bar" @update:foo="val => bar = val"></comp>

ejsoon
Site Admin
Posts: 3767
Joined: 2016 Jan 10, 22:15

VUE axios仍然是跨域

Post by ejsoon » 2018 May 02, 16:24

報錯:
Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
php的解決辦法:
https://blog.csdn.net/veloi/article/details/53836527

ejsoon
Site Admin
Posts: 3767
Joined: 2016 Jan 10, 22:15

VUE axios仍是數據傳輸問題:改post傳輸方式

Post by ejsoon » 2018 May 14, 17:03

來自這裡

Code: Select all

        headers: {
          'Content-type': 'application/x-www-form-urlencoded'
        },
        transformRequest: [function (data) {
          let ret = ''
          for (let it in data) {
            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
          }
          return ret
        }],

Post Reply