Skip to content

Commit

Permalink
Merge pull request #29 from duckzland/master
Browse files Browse the repository at this point in the history
NewFeature: Adding asHtml() to TextWithSlug
  • Loading branch information
tomhatzer committed Apr 4, 2022
2 parents b009a84 + baa7a75 commit ed3dfb1
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 12 deletions.
3 changes: 2 additions & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/field.js": "/js/field.js",
"/css/field.css": "/css/field.css"
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"cross-env": "^5.0.0",
"laravel-mix": "^1.0",
"laravel-nova": "^1.0"
"cross-env": "^7.0.3",
"laravel-mix": "^5.0.9",
"laravel-nova": "^1.6.0"
},
"dependencies": {
"speakingurl": "^14.0.1",
Expand Down
3 changes: 2 additions & 1 deletion resources/js/components/TextWithSlug/IndexField.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<span>{{ field.value }}</span>
<div v-if="field.asHtml" v-html="field.value"></div>
<span v-else class="whitespace-no-wrap">{{ field.value }}</span>
</template>

<script>
Expand Down
20 changes: 14 additions & 6 deletions resources/js/field.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import SlugIndexField from './components/Slug/IndexField';
import SlugDetailField from './components/Slug/DetailField';
import SlugFormField from './components/Slug/FormField';

import TextSlugIndexField from './components/TextWithSlug/IndexField';
import TextSlugDetailField from './components/TextWithSlug/DetailField';
import TextSlugFormField from './components/TextWithSlug/FormField';

Nova.booting((Vue, router) => {
Vue.component('index-nova-slug-field', require('./components/Slug/IndexField'));
Vue.component('detail-nova-slug-field', require('./components/Slug/DetailField'));
Vue.component('form-nova-slug-field', require('./components/Slug/FormField'));
Vue.component('index-nova-slug-field', SlugIndexField);
Vue.component('detail-nova-slug-field', SlugDetailField);
Vue.component('form-nova-slug-field', SlugFormField);

Vue.component('index-nova-textwithslug-field', require('./components/TextWithSlug/IndexField'));
Vue.component('detail-nova-textwithslug-field', require('./components/TextWithSlug/DetailField'));
Vue.component('form-nova-textwithslug-field', require('./components/TextWithSlug/FormField'));
Vue.component('index-nova-textwithslug-field', TextSlugIndexField);
Vue.component('detail-nova-textwithslug-field', TextSlugDetailField);
Vue.component('form-nova-textwithslug-field', TextSlugFormField);
})

0 comments on commit ed3dfb1

Please sign in to comment.