Skip to content

Commit a18f4f0

Browse files
authored
Merge pull request #29 from msouto346/feature/add-svg-support
add svg support
2 parents 2d3ef22 + fe40533 commit a18f4f0

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

dist/js/field.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/components/IndexField.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
>
99
<loading v-if="showLoading" :color="field.loadingColor" />
1010
<span v-else>{{ buttonText }}</span>
11+
<component v-if="svg" :is="svg"></component>
1112
</button>
1213

1314
<!-- Action Confirmation Modal -->
@@ -209,6 +210,10 @@ export default {
209210
disabled() {
210211
return this.field.readonly || ((this.field.showLoadingAnimation || false) && this.loading);
211212
},
213+
214+
svg() {
215+
return this.field.svg || false;
216+
}
212217
},
213218
};
214219
</script>

src/ActionButton.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,14 @@ public function loadingColor(string $loadingColor)
7979
{
8080
return $this->withMeta(compact('loadingColor'));
8181
}
82+
83+
/**
84+
* Pass a vue component containing a svg
85+
*
86+
* @param string $svg
87+
*/
88+
public function svg(string $svg)
89+
{
90+
return $this->withMeta(['svg' => $svg]);
91+
}
8292
}

0 commit comments

Comments
 (0)