Note: get and post are encapsulated in axios.js. Common.js sibling in the directory
//common.js
//InstitutionSetup.vue
Note: get and post are encapsulated in axios.js. Common.js sibling in the directory
//common.js
//InstitutionSetup.vue
Vue.prototype.$axios = axios
the introduction of axios is not mounted on Vue. You can add Vue.prototype.axios = axios before export default and the following code can be used
this
question
you should be Vue.prototype.common = common
this.login ()
this
in this login
is vue
instance
this.common.login ()
this login
this
is common
, not vue
instance
this.common.login.call (this)
can be understood in this way
import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'
export default{
login:function(){
axios.get("", {})
.then(res => {
let { msg, code, data } = res.data;
if (code !== 1) {
this.$message({
message: msg,
type: "error"
});
} else {
console.log(res);
}
})
.catch(function(error) {
console.log(error);
});
}
}
Previous: How to use the svm-rank toolkit under the windows platform?
Next: Use vue-i18n to switch between Chinese and English interfaces
Click the corresponding tag to close the corresponding page, how to write this, please < template > ...
Technical note: vue-cli+elementUI table control Business scenario description: 1.tabletable 2.end_date 3. 4.10>;10>ago solution: use the row-class-name attribute in the elementUI talbe control to determine whether to include the specified fiel...
such as headings, I want to sort the form by dragging within el-dialog. can be dragged if it is placed on the general surface. indicates that I have correctly introduced sortablejs into , but if I put the form on el-dialog, drag sorting will become ...
there is a requirement that when Select selects a city, it needs fuzzy search, which supports not only Chinese, but also pinyin, acronyms and so on. The back end will give me the corresponding fields, but I find that using filter-method to pass in funct...
as shown below, the change event was supposed to pass the numeric size in input. I want to post the scope.row data in this event, but I don t know how to send the two data at the same time. The following way of writing will send out the row data, but...
how is the lower version of the element-ui custom theme initialized? I use version 1.3.4 when et initialization variable files are installed, I am always prompted please install element-theme-chalk but this corresponds to the latest version, a...
treedivtree truepush iterate through the new array. Each item can be closed. How to uncheck the tree at the same time when closing? ...
have you encountered this situation? How to solve it? Why ...
<transition name="fade"> <el-dialog :visible.sync="isShown" :append-to-body=true width="100%" > <div> 111111 < div>...
similar to this form ...
when elementUI uses select, the drop-down position is misplaced and TypeError: PopperJS is not a constructor is reported in vue-popper. [Vue warn]: Error in event handler for "updatePopper": "TypeError: PopperJS is not a constructor&qu...
I would like to ask the < el-tree > component in element-ui, default-checked-keys can be dynamically modified through setCheckedKeys, but the property defaultExpandedKeys does not have the corresponding function, how to modify dynamically? ...
use the component card provided by element-ui to display goods. After getting all the goods at the front end, all the goods are displayed by card external v-for loop output. wants to display four items in one line, but I don t know how to control the ...
the 1.vue project has two parts, permissions and business. The business module is the startup entry of vue. You intend to package the permissions separately, and then the business module introduces this permission package in package.json. 2. Tried npm p...
I encountered a problem when using Element UI. I wanted to customize a component according to el-table, but I found it impossible to render the content of el-tabel-col dynamically. this is the official usage. Use slot to customize the content <temp...
when you open the page after it is introduced on demand, it will prompt you for about 3 seconds console does not show throw error, black question mark face! ...
I would like to ask you how to adjust the width of the primary navigation and the secondary navigation. I try to set the width of .el-row to 100%. < el-aside > Thank you ~ ...
Error in event handler for "row-contextmenu": "TypeError: $event.preventDefault is not a function" Please tell me how to add .client to row-contextmenu . ...
element uiui : add 1: I later commented out < component > < component > dynamic mount components, and there was no problem. But I don t see where there is bugmuri in my code. add 2: through debugging, I have located the problem now, because ...
how can select empty the selected data and display the original placeholder?? here is my code: ...