How to get current template in vuejs

Active3 hr before
Viewed126 times

3 Answers


If you are using Vue 3 and Vue Router 4, here is two simplest ways to get current name of route in setup hook:, Meta Stack Overflow ,This is how you can access AND watch current route's name using @vue/composition-api package with Vue 2 in TypeScript,,Thanks for contributing an answer to Stack Overflow!

Example_snippet/controller/utility/_current.js/ computed: { currentRouteNa. . .
computed: {
   currentRouteName() {
      return this.$;
Step 2 continued with <div>{{ currentRouteName }}</d. . .
<div>{{ currentRouteName }}</div>
Step 3 continued with <div>{{ $ }}</div> . . .
<div>{{ $ }}</div>
load more v

vue-loader assumes you are using single inheritance, that is, you create all components as a direct sub class of Vue, No multiple inheritance between each other

Example_snippet/controller/utility/_current.js/ <script> var table = require('. . .
var table = require('../../../components').datatable

module.exports = table.extend({
   template: ?

load more v

Vue Js Datepicker Tutorial: How to Implement Datepicker in Vue , Vue Js Dynamic jQuery DataTables Tutorial Example , How to Create Calendar Component in Vue Js , Vue Js Display Notification using Vue Toasted Tutorial

Example_snippet/controller/utility/_template.js/ npm install -g @vue/cli vue c. . .
npm install - g @vue / cli

vue create vue - blog

cd vue - blog
load more v