1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import router from '@ohos.router'; 17 18export default { 19 data: { 20 value: 34, 21 startValue: 0, 22 currentValue: 0, 23 endValue: 100, 24 optionName: '关闭旋转表冠' 25 }, 26 onInit() { 27 28 }, 29 onShow() { 30 this.$refs.sliderObj.rotation({focus: true}); 31 }, 32 setValue(e) { 33 this.currentValue = e.value; 34 }, 35 onChangeOption() { 36 if (this.optionName === '关闭旋转表冠') { 37 this.optionName = '开启旋转表冠'; 38 this.$refs.sliderObj.rotation({focus: false}); 39 } else { 40 this.optionName = '关闭旋转表冠'; 41 this.$refs.sliderObj.rotation({focus: true}); 42 } 43 }, 44 backPage() { 45 router.replaceUrl({ 46 uri: 'pages/index/index', 47 }); 48 } 49} 50