var replaceStr = "-";
var str = a.value;
_this.$set(a, "newyasi", str.replace(new RegExp(replaceStr, "gm"), ","));
-sharp-sharp
a.value~
var replaceStr = "-";
var str = a.value;
_this.$set(a, "newyasi", str.replace(new RegExp(replaceStr, "gm"), ","));
-sharp-sharp
a.value~
replace it twice, once for the plus sign and once for the minus sign.
the way downstairs is better.
you can change replaceStr to [+ -]
var str = a.value;
_this.$set(a, 'newyasi', str.replace(/[-+]/mg, ','));
Previous: Ask for css automatic creation tool
Next: How to realize the quick paste function of the list at the front end
dom <el-form-item label=":" :label-width="formLabelWidth" prop="email"> <el-input :disabled="emailDis" v-model="sideForm.email" auto-complete="off" placeholder="&...
export const state = () => ({ wishNum: 0 }); export const mutations = { SET_WISH: (state) => { state.wishNum = 0; }, } let Num = res.total; setStore("wishNum", Num); -sharp-sharp whether I am writing this correctly. I ...
functional requirements: there is a search box on the home page and a search box on the list page. Enter the search content on the home page and jump to the search page to perform the search . nuxt implementation: save the searchKeyWords field into v...
I looked through iview s changelog and commit records to figure out how iview solved the SSR problem, but I couldn t find the relevant code (maybe I didn t translate it in detail enough), so I d like to ask developers who are familiar with iview, iv...
error type check failed for prop "news " when using Nuxt.js. Expected Array, got Function. Found in . but there is no problem with re-npm run dev, but this error is reported every time the browser is changed a little. But the terminal is normal. <...
the nuxt framework uses asyncData, and needs to be re-npm run dev every time it changes. Otherwise, the error will be reported, and the code and error will be as follows asyncData({ params }) { let getNews = axios.getNews({ limit: 2 }) let ge...
recently, a problem has been found in the project of rendering all ends of the server with nuxt.js. For example, there are multiple concurrent requests on a page, and as long as there is a problem with one request, the whole page will not work. When rend...