springboot vue前后端分离项目,Vue+SpringBoot前后端分离中的跨域问题
vue+SpringBoot前后端分离学习经验在前后端分离开发中,需要前端调用后端api并进行内容显示,如果前后端开发都在一台主机上,则会由于浏览器的同源策略限制,出现跨域问题(协议、域名、端口号不同
顺晟科技
2021-08-23 18:20:17
345
html代码:
顺晟科技:
export default {name: ‘mulSelect’,props: {selectArray: { type: Array, default: ()=>{return []} },itemKey: { type: String, default: ‘id’ },itemValue: { type: String, default: ‘value’ },},data() {return {result:{}}},methods: {handleChange(value, option) {console.log(value)console.log(option)this.result=option},},}
describe(‘mulSelect.vue’, () => {it(‘xxx’, async () => { //注意这里的asyncconst wrapper = mount(mulSelect, {propsData: {selectArray: [{id: 1,name: ‘huang’,age: 23,value: ‘huangxin’},]},// stubs: [‘a-select’, ‘a-select-option’]})
})
测试代码import { mount } from ‘@vue/test-utils’import mulSelect from ‘@/components/mulSelect.vue’
结果:expect(received).toBe(expected) // Object.is equality
为什么多选框的chage函数没有触发????
23
2022-09
13
2022-09
13
2022-09
13
2022-09
13
2022-09
03
2022-09