Browse Source

support chip color on autocomplete

chenxin0723 1 year ago
parent
commit
a78fdeee44

+ 10 - 0
vuetifyx/autocomplete-fix.go

@@ -53,6 +53,16 @@ func (b *VXAutocompleteBuilder) Items(v interface{}) (r *VXAutocompleteBuilder)
 	return b
 }
 
+func (b *VXAutocompleteBuilder) ChipColor(v string) (r *VXAutocompleteBuilder) {
+	b.tag.Attr("chip-color", v)
+	return b
+}
+
+func (b *VXAutocompleteBuilder) ChipTextColor(v string) (r *VXAutocompleteBuilder) {
+	b.tag.Attr("chip-text-color", v)
+	return b
+}
+
 func (b *VXAutocompleteBuilder) SetDataSource(ds *AutocompleteDataSource) (r *VXAutocompleteBuilder) {
 	b.tag.Attr("remote-url", ds.RemoteURL)
 	b.tag.Attr("event-name", ds.EventName)

File diff suppressed because it is too large
+ 0 - 0
vuetifyx/vuetifyxjs/dist/vuetifyxjs.umd.min.js


+ 5 - 1
vuetifyx/vuetifyxjs/src/components/Autocomplete.tsx

@@ -20,6 +20,8 @@ export default Vue.extend({
 		hideSelected: Boolean,
 		hideDetails: Boolean,
 		sorting: Boolean,
+		chipColor: String,
+		chipTextColor: String,
 		items: {
 			type: Array,
 			default: () => ([]),
@@ -224,8 +226,10 @@ export default Vue.extend({
 				const nodes: VNode[] = [];
 				const nodeData: VNodeData = {
 					props: {
-						...props.attrs,
+						draggable: true,
 						close: true,
+						color: this.chipColor,
+						"text-color": this.chipTextColor,
 					},
 					on: {
 						"click:close": () => {

Some files were not shown because too many files changed in this diff