@@ -37,12 +37,25 @@ class Progress extends Base {
3737 * @member {Object} _vdom
3838 */
3939 _vdom :
40- { tag : 'div' , cls : [ 'neo-progress' ] , cn : [
40+ { tag : 'div' , cls : [ 'neo-progress-wrapper ' ] , cn : [
4141 { tag : 'label' } ,
4242 { tag : 'progress' }
4343 ] }
4444 }
4545
46+ /**
47+ * @member {Object} label
48+ */
49+ get label ( ) {
50+ return this . vdom . cn [ 0 ]
51+ }
52+ /**
53+ * @member {Object} progress
54+ */
55+ get progress ( ) {
56+ return this . vdom . cn [ 1 ]
57+ }
58+
4659 /**
4760 * Triggered after the id config got changed
4861 * @param {String } value
@@ -52,7 +65,7 @@ class Progress extends Base {
5265 afterSetId ( value , oldValue ) {
5366 super . afterSetId ( value , oldValue ) ;
5467
55- this . vdom . cn [ 0 ] . for = value ;
68+ this . label . for = value ;
5669 this . update ( )
5770 }
5871
@@ -63,7 +76,15 @@ class Progress extends Base {
6376 * @protected
6477 */
6578 afterSetLabelText ( value , oldValue ) {
66- this . vdom . cn [ 0 ] . html = value ;
79+ let { label} = this ;
80+
81+ if ( ! value ) {
82+ label . removeDom = true
83+ } else {
84+ delete label . removeDom
85+ }
86+
87+ label . html = value ;
6788 this . update ( )
6889 }
6990
@@ -74,7 +95,7 @@ class Progress extends Base {
7495 * @protected
7596 */
7697 afterSetMax ( value , oldValue ) {
77- this . vdom . cn [ 1 ] . max = value ;
98+ this . progress . max = value ;
7899 this . update ( )
79100 }
80101
@@ -85,7 +106,7 @@ class Progress extends Base {
85106 * @protected
86107 */
87108 afterSetValue ( value , oldValue ) {
88- this . vdom . cn [ 1 ] . value = value ;
109+ this . progress . value = value ;
89110 this . update ( )
90111 }
91112
0 commit comments