Can't going to next page in vue.js
carrier/components/index.vue
<d-button @click.native = "addCarrier();"><i class="icon icon-sm"></i><span>New</span></i></d-button>
<script>
import axios from 'axios'
import { ROAST_CONFIG } from '../../../../config/config.js';
import CarrierAdd from './Add.vue';
var baseUrl = ROAST_CONFIG.API_URL;
export default {
components: {
'carrier-add':CarrierAdd,
},
data () {
return {
form: {
showTop: false,
componentLoading:true,
},
}
},
mounted () {
setTimeout(() => {
this.componentLoading = false;
},500);
},
methods: {
addCarrier() {
alert(this.$parent.currentComponent);
this.$parent.currentComponent = "carrier-add";
this.$router.push({name:"CarriersNew"});
}
}
}
carrier/components/Add.vue
<template>
<h1>Carrier Add</h1>
</template>
route.js
import Carriers from 'page/admin/carriers/index.vue';
{ path: '/admin/carriers', name:'Carriers', component: Carriers },
{ path: '/admin/carriers/new', name:'CarriersNew', component: Carriers },
I can't be going to the add page from the index page. How can I go to that page please help me.
vue.js
add a comment |
carrier/components/index.vue
<d-button @click.native = "addCarrier();"><i class="icon icon-sm"></i><span>New</span></i></d-button>
<script>
import axios from 'axios'
import { ROAST_CONFIG } from '../../../../config/config.js';
import CarrierAdd from './Add.vue';
var baseUrl = ROAST_CONFIG.API_URL;
export default {
components: {
'carrier-add':CarrierAdd,
},
data () {
return {
form: {
showTop: false,
componentLoading:true,
},
}
},
mounted () {
setTimeout(() => {
this.componentLoading = false;
},500);
},
methods: {
addCarrier() {
alert(this.$parent.currentComponent);
this.$parent.currentComponent = "carrier-add";
this.$router.push({name:"CarriersNew"});
}
}
}
carrier/components/Add.vue
<template>
<h1>Carrier Add</h1>
</template>
route.js
import Carriers from 'page/admin/carriers/index.vue';
{ path: '/admin/carriers', name:'Carriers', component: Carriers },
{ path: '/admin/carriers/new', name:'CarriersNew', component: Carriers },
I can't be going to the add page from the index page. How can I go to that page please help me.
vue.js
Please be more specific. What happens when you click the button? Is the alert appearing? Is the URL changing? Do you get an error message in the console?
– str
Nov 16 '18 at 12:00
Yes, alert message is coming and url also changing. And I am getting error likevue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <carrier-add> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
– Kevin
Nov 16 '18 at 12:07
add a comment |
carrier/components/index.vue
<d-button @click.native = "addCarrier();"><i class="icon icon-sm"></i><span>New</span></i></d-button>
<script>
import axios from 'axios'
import { ROAST_CONFIG } from '../../../../config/config.js';
import CarrierAdd from './Add.vue';
var baseUrl = ROAST_CONFIG.API_URL;
export default {
components: {
'carrier-add':CarrierAdd,
},
data () {
return {
form: {
showTop: false,
componentLoading:true,
},
}
},
mounted () {
setTimeout(() => {
this.componentLoading = false;
},500);
},
methods: {
addCarrier() {
alert(this.$parent.currentComponent);
this.$parent.currentComponent = "carrier-add";
this.$router.push({name:"CarriersNew"});
}
}
}
carrier/components/Add.vue
<template>
<h1>Carrier Add</h1>
</template>
route.js
import Carriers from 'page/admin/carriers/index.vue';
{ path: '/admin/carriers', name:'Carriers', component: Carriers },
{ path: '/admin/carriers/new', name:'CarriersNew', component: Carriers },
I can't be going to the add page from the index page. How can I go to that page please help me.
vue.js
carrier/components/index.vue
<d-button @click.native = "addCarrier();"><i class="icon icon-sm"></i><span>New</span></i></d-button>
<script>
import axios from 'axios'
import { ROAST_CONFIG } from '../../../../config/config.js';
import CarrierAdd from './Add.vue';
var baseUrl = ROAST_CONFIG.API_URL;
export default {
components: {
'carrier-add':CarrierAdd,
},
data () {
return {
form: {
showTop: false,
componentLoading:true,
},
}
},
mounted () {
setTimeout(() => {
this.componentLoading = false;
},500);
},
methods: {
addCarrier() {
alert(this.$parent.currentComponent);
this.$parent.currentComponent = "carrier-add";
this.$router.push({name:"CarriersNew"});
}
}
}
carrier/components/Add.vue
<template>
<h1>Carrier Add</h1>
</template>
route.js
import Carriers from 'page/admin/carriers/index.vue';
{ path: '/admin/carriers', name:'Carriers', component: Carriers },
{ path: '/admin/carriers/new', name:'CarriersNew', component: Carriers },
I can't be going to the add page from the index page. How can I go to that page please help me.
vue.js
vue.js
asked Nov 16 '18 at 11:53
KevinKevin
3701324
3701324
Please be more specific. What happens when you click the button? Is the alert appearing? Is the URL changing? Do you get an error message in the console?
– str
Nov 16 '18 at 12:00
Yes, alert message is coming and url also changing. And I am getting error likevue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <carrier-add> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
– Kevin
Nov 16 '18 at 12:07
add a comment |
Please be more specific. What happens when you click the button? Is the alert appearing? Is the URL changing? Do you get an error message in the console?
– str
Nov 16 '18 at 12:00
Yes, alert message is coming and url also changing. And I am getting error likevue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <carrier-add> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
– Kevin
Nov 16 '18 at 12:07
Please be more specific. What happens when you click the button? Is the alert appearing? Is the URL changing? Do you get an error message in the console?
– str
Nov 16 '18 at 12:00
Please be more specific. What happens when you click the button? Is the alert appearing? Is the URL changing? Do you get an error message in the console?
– str
Nov 16 '18 at 12:00
Yes, alert message is coming and url also changing. And I am getting error like
vue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <carrier-add> - did you register the component correctly? For recursive components, make sure to provide the "name" option. – Kevin
Nov 16 '18 at 12:07
Yes, alert message is coming and url also changing. And I am getting error like
vue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <carrier-add> - did you register the component correctly? For recursive components, make sure to provide the "name" option. – Kevin
Nov 16 '18 at 12:07
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337364%2fcant-going-to-next-page-in-vue-js%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337364%2fcant-going-to-next-page-in-vue-js%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please be more specific. What happens when you click the button? Is the alert appearing? Is the URL changing? Do you get an error message in the console?
– str
Nov 16 '18 at 12:00
Yes, alert message is coming and url also changing. And I am getting error like
vue.runtime.esm.js?2b0e:587 [Vue warn]: Unknown custom element: <carrier-add> - did you register the component correctly? For recursive components, make sure to provide the "name" option.– Kevin
Nov 16 '18 at 12:07