Bootstrap 5-以编程方式打开导航选项卡

时间:2020-08-12 17:47:57

标签: javascript vue.js

我正在将Bootstrap 5用于vue项目。我创建了一个具有两个导航tabs的组件以显示一些内容,并且如果用户执行操作,则需要显示第二个选项卡。我正在使用data属性来触发普通标签的可视化,但是我想在用户操作之后以编程方式显示第二个标签。谁能帮我?我已经尝试过使用此代码,但是没有用

orders_dataframe <- data.frame(Order = c(1,2,3,4,5,6,7),
                               Channel = c("TV", "Email", "Retail", "Shop1", "Shop2", "Email", "Retail"), 
                               Revenue = c(120,30,300,50,90,20,250))

# Coerce the channel factor to a string.
# Do you really want this as a factor?
orders_dataframe$Channel <- as.character(orders_dataframe$Channel)

# Create a vector of the replacement values.
# The prob = c() argument lets you pick the
# probabilities of each replacement.
replacement <- sample(x = c("Store1","Store2"),
                      size = length(which(orders_dataframe$Channel == "Retail")),
                      replace = TRUE, prob = c(0.6, 0.4))

# Replace the Channel columnn with the replacement vector.
orders_dataframe$Channel[which(orders_dataframe$Channel == "Retail")] <- replacement
    <nav class="nav mt-2 mb-2" role="tablist">
      <a class="nav-link active p-0 pr-2" role="tab" href="#program-tab" data-toggle="tab">Info</a>
      <a class="nav-link p-0 pr-2" role="tab" href="#download-tab" data-toggle="tab">Downloads</a>
    </nav>

<div class="row tab-pane fade m-0" id="download-tab" role="tabpanel" ref="downloadTab">...</div>


0 个答案:

没有答案