py-test-component 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "py-test-component",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Vue2 + ElementUI 组件库,支持 React 使用",
5
5
  "main": "dist/py-component.js",
6
6
  "module": "dist/py-component.esm.js",
@@ -94,8 +94,8 @@ export const PyTable = forwardRef(function PyTable({ data, loading: propsLoading
94
94
 
95
95
  useEffect(() => {
96
96
  if (elRef.current && data && loaded) {
97
- // 通过属性传递数据(vue-custom-element 会自动解析 JSON 字符串)
98
- elRef.current.setAttribute('table-data', JSON.stringify(data));
97
+ // 直接设置 property,比 setAttribute 更可靠
98
+ elRef.current.tableData = data;
99
99
  }
100
100
  }, [data, loaded]);
101
101