Polyfill for Vuejs


(Jeff) #1

I am working on a website that uses the Yii1 framework. We have started using Vuejs to make certain tasks a little easier. One problem, though, is that IE11 does not accept all the syntax that other browsers do. The specific problem I’m running into is that the template can be put between ``, but IE11 does not accept that. Of course, I could use single quotes and escape single quotes inside of the template, but that is very tedious. I have heard that using babel polyfill can correct this, but I’m having a hard time figuring out how to use it with Yii.

Example:


Vue.component('forum-example', {

	props: ['forum', 'comments', 'question', 'title'],

	template: `

	<div class='forum-example-container' v-bind:data-question-id='question.id'>

		<question-details

			@toggle-expanded='expanded = !expanded'

			:question="question"

			:comments="comments"

			:forum="forum"

			:title="title"

			:key="question.key">

		</question-details>

	</div>

	`,

	data: function() {

		return {

			expanded: false,

		}

	},

});