The ``in router.push ({path: `/ user/$ {userId}`}) is changed to''. Is there any difference?

in navigational programming in vue-router:

router.push({ path: `/user/${userId}` }) // -> /user/123

can be written as:

router.push({ path: "/user/${userId}" })

?

is there any difference between ``and""here?
if there is no difference, then why use ``in the document?

Mar.02,2021

is different. ``is a template string in es6, while in''there is a common string


router.push({ path: `/user/${userId}` }) // -> /user/123

// 
router.push({ path: '/user/'+userId) // -> /user/123

, which saves the splicing process

.
Menu