Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color属性值为false时还是使用style属性 #1376

Open
startjava opened this issue Apr 9, 2024 · 0 comments
Open

color属性值为false时还是使用style属性 #1376

startjava opened this issue Apr 9, 2024 · 0 comments

Comments

@startjava
Copy link

#864
根据上面的提示,发现color和style是结合使用的,但color是false时还是使用style样式,文字还是绿色的,示例代码如下:

import {createApp, onMounted} from 'vue'
import Player from 'xgplayer';
import 'xgplayer/dist/index.min.css';
import Danmu from 'xgplayer/es/plugins/danmu'
import 'xgplayer/es/plugins/danmu/index.css'

createApp({
    setup() {
        onMounted(() => {
            const comments = [{
                duration: 10000,
                id: 1,
                start: 1000,
                color: true,
                txt: "我是弹幕1",
                style: {
                    color: 'red',
                    fontSize: '20px',
                    padding: '0px 0px'
                },
                mode: "scroll"
            }, {
                duration: 10000,
                id: 2,
                start: 1000,
                color: false,
                txt: "我是弹幕2",
                style: {
                    color: 'green',
                    fontSize: '20px',
                    padding: '0px 0px'
                },
                mode: "scroll"
            }
            ];

            let player = new Player({
                id: 'xgplayerDiv',
                url: '../xgplayer-demo-720p.mp4',
                height: '100%',
                width: '100%',
                plugins: [Danmu],
                danmu: {
                    comments: comments
                }
            });
        });
    }
}).mount("#mydiv1");

运行效果如下:
image

color都false了,文字不应该是彩色的啊。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant