12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- const { testTransform } = require('../test-helper');
- const transform = require('./transform');
- const input = `
- <template>
- <div class="widget">
- Hello {{name}}
- </div>
- </template>
- <script>
- export default {
- props: {
- name: {
- type: String,
- required: true
- },
- location: {
- type: String,
- required: false
- },
- age: {
- type: String
- }
- },
- computed: {
- hasName() {
- return !!this.name;
- }
- }
- };
- </script>
- <style>
- .widget {
- color: red;
- }
- </style>
- `;
- const output = `
- <template>
- <div class="widget">
- Hello {{name}}
- </div>
- </template>
- <script>
- export default {
- props: {
- name: {
- type: String,
- required: true
- },
- location: {
- type: String,
- required: true
- },
- age: {
- type: String,
- required: true
- }
- },
- computed: {
- hasName() {
- return !!this.name;
- }
- }
- };
- </script>
- <style>
- .widget {
- color: red;
- }
- </style>
- `;
- testTransform(transform, 'Widget.vue', input, output);
|