Skip to content

Instantly share code, notes, and snippets.

@freearhey
Created August 31, 2016 05:45
Show Gist options
  • Save freearhey/840a2445d96a9b10c375492c9cc56edb to your computer and use it in GitHub Desktop.
Save freearhey/840a2445d96a9b10c375492c9cc56edb to your computer and use it in GitHub Desktop.
Использование vue.js в XSLT шаблоне
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="template.xsl" type="text/xsl" ?>
<collection />
Vue.component('hello', {
template: '#hello-template',
data: function() {
return {
greeting: 'Hola!'
}
}
})
new Vue({
el: 'body'
})
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<hello></hello>
<template id="hello-template">
<h1>{{ greeting }}</h1>
</template>
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js"></script>
<script src="main.js"></script>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment