How to mock data with mocks-server and use mvc pattern in nuxtjs

Some week ago I start write new admin panel for some service with nuxtjs and we decide to use "mvc" pattern on frontend without using vuex, for mocking data we use - "@mocks-server/main": "^2.1.0". So, here we go? 1st of all create api folder in our project.…

How to use external scripts in nuxtjs correctly

I need to add external script ( contact widget ) on nuxtjs site. First of all i try to add it into default.vue file - when i start 'npm run dev' all works good locally, but on dev server this script was erased. Solution it's add script in nuxt.config.js…

Delays in redux-saga

Mini-note. Today i need to change 1 property to true and after 2 seconds to false. At first I thought to solve the problem head-on. And I google something like "setTimeout in redux-saga". function* changeProp() { yield put({ type: SET_SOME_PROP, payload: true }); setTimeout(function*() { yield ({ type: SET_SOME_PROP,…

A little hack in react-router-dom

On the current project, I encountered a bug. In component i have 2 links they implement with <Button> component with type="link". Something like this. //component.tsx <Button type="link" onClick={someMethod} size="someSize" className="someClassName">Button text</Button>And with this implementation we…

How to use custom icons in antd collapse component

Simple note.We use antd collapse component, but we need change collapse and expand icons.Create CustomCollapse component.…