dskzpt / typo3-ux-vue
Easily render Vue.js components in Fluid Templates
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- ssch/typo3-encore: ^5.0.5
- symfony/ux-vue: ^2.6
Requires (Dev)
- ergebnis/composer-normalize: ^2.24
- friendsoftypo3/phpstan-typo3: ^0.9.0
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.4
- typo3/coding-standards: ^0.6.1
Suggests
- ssch/typo3-encore: Integrates Webpack Encore into TYPO3
README
TYPO3 Extension "typo3-ux-vue"
What does it do?
Render Vue components directly in Fluid template
This Extensions enables you to render Vue Components directly in Fluid templates. It acts as an integration for symfony/ux-vue into TYPO3.
Installation
The recommended way to install the extension is by using Composer. In your Composer based TYPO3 project root, just run:
composer require dskzpt/typo3-ux-vue
Setup
Before you start, make sure you have EXT:typo3_encore. This extensions integrates Webpack Encore into TYPO3.
Follow the Symfony UX Vue official documentation.
Additionally:
# Add this line to your package.json dependencies:
"@symfony/ux-vue": "file:vendor/symfony/ux-vue/assets"
# Add these two lines to your app.js:
import {registerVueControllerComponents} from '@symfony/ux-vue';
registerVueControllerComponents(require.context('./vue/controllers', true, /\.vue$/));
# Install Vue.js
$ npm i vue
# or
$ yarn add vue
# Add these lines to your controllers.json:
"@symfony/ux-vue": {
"vue": {
"enabled": true,
"fetch": "eager"
}
}
# run
$ npm install --force
$ npm run watch
# or
$ yarn install --force
$ yarn watch
Usage
In any fluid template: Just register the Namespace and use the provided ViewHelper to render your component:
<html xmlns:ux="http://typo3.org/ns/DSKZPT/UX/Vue/ViewHelpers">
<div {ux:vueComponent(name:'MyComponent',props:"{'name':'John Doe'}")}></div>
</html>
Contributing
Please refer to the contributing document included in this repository.