From a4efb55ffc8ab450cb9452f35fede881ea6a2b3c Mon Sep 17 00:00:00 2001 From: Imshann <851188611@qq.com> Date: Fri, 21 Jan 2022 18:31:30 +0800 Subject: [PATCH] feat(table): 优化组件 --- build/Slot/Slot.js | 1 - dist/ng-antd.js | 2 +- example/table/inner-scope.html | 45 --------------------------------------------- example/table/render-scope.html | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/Slot/Slot.js | 1 - 5 files changed, 46 insertions(+), 48 deletions(-) delete mode 100644 example/table/inner-scope.html create mode 100644 example/table/render-scope.html diff --git a/build/Slot/Slot.js b/build/Slot/Slot.js index 9885795..d82f676 100644 --- a/build/Slot/Slot.js +++ b/build/Slot/Slot.js @@ -17,7 +17,6 @@ angular.module("esNgAntd").directive("antdSlot", function ($compile) { content: (newValue) => { if (newValue !== undefined) { if (/<[^>]+>/.test(newValue)) { - console.log(newValue); $element.replaceWith( $compile(newValue)( $scope.context ? $scope.context : $scope diff --git a/dist/ng-antd.js b/dist/ng-antd.js index b0d6abe..013dae9 100644 --- a/dist/ng-antd.js +++ b/dist/ng-antd.js @@ -367,7 +367,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Sel \****************************/ /***/ (() => { -eval("angular.module(\"esNgAntd\").directive(\"antdSlot\", function ($compile) {\n return {\n controllerAs: \"antdSlot\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n content: \"@\",\n context: \"=\",\n },\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.watch = {\n content: (newValue) => {\n if (newValue !== undefined) {\n if (/<[^>]+>/.test(newValue)) {\n console.log(newValue);\n $element.replaceWith(\n $compile(newValue)(\n $scope.context ? $scope.context : $scope\n )\n );\n } else {\n $element.text(newValue);\n }\n }\n },\n };\n\n for (const key in $scope.watch) {\n $scope.$watch(key, $scope.watch[key], true);\n }\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {},\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Slot/Slot.js?"); +eval("angular.module(\"esNgAntd\").directive(\"antdSlot\", function ($compile) {\n return {\n controllerAs: \"antdSlot\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n content: \"@\",\n context: \"=\",\n },\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.watch = {\n content: (newValue) => {\n if (newValue !== undefined) {\n if (/<[^>]+>/.test(newValue)) {\n $element.replaceWith(\n $compile(newValue)(\n $scope.context ? $scope.context : $scope\n )\n );\n } else {\n $element.text(newValue);\n }\n }\n },\n };\n\n for (const key in $scope.watch) {\n $scope.$watch(key, $scope.watch[key], true);\n }\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {},\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Slot/Slot.js?"); /***/ }), diff --git a/example/table/inner-scope.html b/example/table/inner-scope.html deleted file mode 100644 index f0b02f6..0000000 --- a/example/table/inner-scope.html +++ /dev/null @@ -1,45 +0,0 @@ - - - -
- -